1.获取当前时间 var now = new DateTime.now(); print(now); // 2019-06-20 16:59:05.560543 2.设置时间 var d =new DateTime(2019, 6, 20, 16, 37 , 26); print(d); // 2019-06-20 16:37:26.000 3.创建时间UTC var ds = new DateTime.utc(2019, 10, 10, 9, 30); print(ds); // 2019-1