timestampToTime function
时间戳转时间
Implementation
DateTime timestampToTime(int? timestamp, {TimeLength timeLength = TimeLength.ten}) {
if (timestamp == null) {
return DateTime.now();
}
int a = 0;
if (timeLength == TimeLength.ten) {
a = timestamp * 1000;
} else {
a = timestamp;
}
return DateTime.fromMillisecondsSinceEpoch(a);
}