当前位置:网站首页>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())
边栏推荐
猜你喜欢
随机推荐
停止使用 Storyboards 和 Interface Builder
典型相关分析CCA计算过程
Speech Synthesis Model Cheat Sheet (1)
精心整理16条MySQL使用规范,减少80%问题,推荐分享给团队
1 - vector R language self-study
4、Citrix MCS云桌面无法安装todesk等软件
服务间歇性停顿问题优化|得物技术
CTF命令执行题目解题思路
几种常见的跨域解决方法
MySQL的多表查询(1)
用了 TCP 协议,数据一定不会丢吗?
APT level comprehensive free kill with Shell
@GetMapping、@PostMapping、@PutMapping、@DeleteMapping的区别
【代码扫描修复】MD5加密弱HASH漏洞
合并两个excel表格工具
matplotlib中的3D绘图警告解决:MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure
机器学习-特征映射方法
I have been in the software testing industry for nearly 20 years, let me talk to you about today's software testing
Week 7 CNN Architectures - LeNet-5、AlexNet、VGGNet、GoogLeNet、ResNet
分库分表索引设计:二级索引、全局索引的最佳设计实践









