当前位置:网站首页>flutter 时间戳转日期
flutter 时间戳转日期
2022-08-02 23:19:00 【氤氲息】
///得到留言时间
String getMessageTime() {
String time = '';
int timestamp = downList.createTime! * 1000;
DateTime timeDate = DateTime.fromMillisecondsSinceEpoch(timestamp);
DateTime now = DateTime.now();
if (now.day == timeDate.day) {
time =
"${timeDate.hour.toString().padLeft(2, '0')}:${timeDate.minute.toString().padLeft(2, '0')}:${timeDate.second.toString().padLeft(2, '0')}";
} else {
time =
"${timeDate.month.toString().padLeft(2, '0')}-${timeDate.day.toString().padLeft(2, '0')} ${timeDate.hour.toString().padLeft(2, '0')}:${timeDate.minute.toString().padLeft(2, '0')}:${timeDate.second.toString().padLeft(2, '0')}";
}
return time;
}
ContentCenterText(
getMessageTime(), 10.0, CommonColors.getTextWeakColor())
边栏推荐
- DownMusic总结记录
- nmap: Bad CPU type in executable
- 【代码扫描修复】MD5加密弱HASH漏洞
- 思源笔记 本地存储无使用第三方同步盘,突然打不开文件。
- RollBack Rx Professional RMC 安装教程
- WebShell 木马免杀过WAF
- Cholesterol-PEG-Amine,CLS-PEG-NH2,胆固醇-聚乙二醇-氨基脂两亲性脂质衍生物
- Test | ali internship 90 days in life: from the perspective of interns, talk about personal growth
- 2022杭电多校第一场(K/L/B/C)
- 合并两个excel表格工具
猜你喜欢

程序员常说的“左手锟斤拷,右手烫烫烫”是怎么回事?

MySQL最大建议行数2000w, 靠谱吗?

VMware workstation program starts slowly

程序员的七夕浪漫时刻

公司招个程序员,34岁以上两年一跳的不要,开出工资以为看错了

1 - vector R language self-study

The latest real software test interview questions are shared. Are you afraid that you will not be able to enter the big factory after collecting them?

九零后程序员心声:互联网的同行们,别卷了,再卷人都卷没了

脂溶性胆固醇-聚乙二醇-叠氮,Cholesterol-PEG-Azide,CLS-PEG-N3

LVM与磁盘配额原理及配置
随机推荐
Directing a non-relational database introduction and deployment
即席查询—— Kylin使用
思源笔记 本地存储无使用第三方同步盘,突然打不开文件。
VMware workstation program starts slowly
vant-swipe adaptive picture height + picture preview
数据库审计 - 网络安全的重要组成部分
MySQL最大建议行数2000w, 靠谱吗?
NLP常用Backbone模型小抄(1)
C语言函数详解(2)【函数参数——实际参数(实参)&形式参数(形参)】
令人心动的AI综述(1)
HCIP(16)
技术分享 | 接口自动化测试中如何对xml 格式做断言验证?
用了这么多年的LinkedList,作者说自己从来不用它?为什么?
Rasa 3.x 学习系列- Rasa - Issues 4792 socket debug logs clog up debug feed学习笔记
几种常见的跨域解决方法
Canonical correlation analysis of CCA calculation process
DownMusic summary record
秒懂网络拓扑中的下一跳地址
1 - vector R language self-study
聚乙二醇衍生物4-Arm PEG-DSPE,四臂-聚乙二醇-磷脂