Answers for "string date to format dart flutter"

7

datetime dart format print

//You can use the intl package https://pub.dev/packages/intl/install

import 'package:intl/intl.dart';

main() {
  final DateTime now = DateTime.now();
  final DateFormat formatter = DateFormat('yyyy-MM-dd');
  final String formatted = formatter.format(now);
  print(formatted); // something like 2013-04-20
}
Posted by: Guest on September-27-2020
0

Flutter String to dateTime format

DateTime tempDate = new DateFormat("yyyy-MM-dd hh:mm:ss").parse(savedDateString);
Posted by: Guest on January-11-2022

Code answers related to "Dart"

Browse Popular Code Answers by Language