import 'package:intl/intl.dart';
static final DateTime now = DateTime.now();
Want to format?
static final DateFormat formatter = DateFormat('yyyy-MM-dd');
final String formatted = formatter.format(now);
OR
DateTime dateToday = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day) ;
import 'package:intl/intl.dart';
main() {
var now = new DateTime.now();
var formatter = new DateFormat('yyyy-MMM-dd');
String formatted = formatter.format(now);
print(formatted); // something like 2019-Jun-20
}
print(berlinWallFell.year); // 1989
print(berlinWallFell.month); // 11
print(berlinWallFell.day); // 9
print(moonLanding.hour); // 20
print(moonLanding.minute); // 18