Issue
'''final Time = uniqueid + DateTime.now().toString() + DateTime.now().millisecond.toString();'''
and get Time =uniqueid2022-01-24 16:42:03 .901280901 need Time =uniqueid20220124164203901280901
Solution
we can use this method to get exact result first add plugin intl
flutter pub add intl
then import
import 'package:intl/intl.dart';
then use this where you need the formatted date
final DateTime now = DateTime.now();
final DateFormat formatter = DateFormat('yyyyMMddkkmms');
final String formatted = formatter.format(now);
final Time = unique + formatted + DateTime.now().millisecondsSinceEpoch.toString();
Answered By - Shafi Asharaf
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.