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));
更多关于Flutter日期和时间戳的相互转换的实战系列教程也可以访问 https://www.itying.com/category-92-b0.html