Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

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
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #datetime #dart #format #print
ADD COMMENT
Topic
Name
2+5 =