Flutter日期和时间戳的相互转换
一、Flutter中日期转换成时间戳
var now = new DateTime.now();
print(now.millisecondsSinceEpoch);//单位毫秒,13位时间戳
二、Flutter中时间戳转化成日期
var now = new DateTime.now();
var a=now.millisecondsSinceEpoch; //时间戳
print(DateTime.fromMillisecondsSinceEpoch(a));