如何获取Dart中星期几的名称 [英] How get the name of the days of the week in Dart
本文介绍了如何获取Dart中星期几的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道如何从DateTime中提取星期几的名称吗?
Somebody knows how can I extract from DateTime the name of the day of the week?
ej:
DateTime date = DateTime.now();
String dateFormat = DateFormat('dd-MM-yyyy hh:mm').format(date);
结果->星期五
推荐答案
使用'EEEE'作为日期模式
Use 'EEEE' as a date pattern
DateFormat('EEEE').format(date);
检查此信息以获取更多信息: https://docs.flutter.io/flutter/intl/DateFormat-class.html
Check this for more info : https://docs.flutter.io/flutter/intl/DateFormat-class.html
这篇关于如何获取Dart中星期几的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文