Answers for "how to convert duration to datetime in flutter"

27

flutter convert datetime in day of month

import 'package:intl/intl.dart';

DateTime now = DateTime.now();
String formattedDate = DateFormat('yyyy-MM-dd – kk:mm').format(now);
Posted by: Guest on September-10-2020
8

flutter date time to timestamp

DateTime currentPhoneDate = DateTime.now(); //DateTime

Timestamp myTimeStamp = Timestamp.fromDate(currentPhoneDate); //To TimeStamp

DateTime myDateTime = myTimeStamp.toDate(); // TimeStamp to DateTime

print("current phone data is: $currentPhoneDate");
print("current phone data is: $myDateTime");
Posted by: Guest on June-22-2020

Code answers related to "how to convert duration to datetime in flutter"

Code answers related to "Dart"

Browse Popular Code Answers by Language