Datetime Dart Format Print

[Solved] Datetime Dart Format Print | Dart - Code Explorer | yomemimo.com
Question : datetime dart format print

Answered by : glamorous-gibbon-w2fwom39789o

//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 : https://stackoverflow.com/questions/16126579/how-do-i-format-a-date-with-dart | Last Update : Sun, 04 Oct 20

Question : how to format a date in Dart

Answered by : mathias-godwin

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 : https://stackoverflow.com/questions/16126579/how-do-i-format-a-date-with-dart | Last Update : Tue, 28 Jun 22

Answers related to datetime dart format print

Code Explorer Popular Question For Dart