可以得到现在的时间日期,也可以进行日期的比较,还可以判断几天之后多少天等之类的情况
var Now = DateTime.Now();
var berlinWallFell = DateTime.utc(1989, 11, 9);
var moonLanding = DateTime.parse("1969-07-20 20:18:04Z"); /
var Now = DateTime.Now();
var sixtyDaysFromNow = Now.add(const Duration(days: 60));
具体参看api文档
https://api.dart.dev/stable/2.13.4/dart-core/DateTime-class.html