如何将 DateTime 从军用时间中取出?

问题描述 投票:0回答:1

正在开发这个应用程序并且项目运行顺利,该应用程序的很大一部分是它显示输入的时间数据,但我无法弄清楚如何从 24 小时格式中获取时间这里 enter image description here 是应用程序中当前的样子

已经看过其他一些堆栈解决方案,但我不知道如何实现它们

flutter datetime user-interface datetime-format
1个回答
0
投票

您可以使用日期格式。例如:

final myDate = DateTime.now();
final formattedDate = DateFormat('MMMM dd, yyyy h:mm a').format(myDate);
© www.soinside.com 2019 - 2024. All rights reserved.