可以得到现在的时间日期,也可以进行日期的比较,还可以判断几天之后多少天等之类的情况
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