有人知道如何从 DateTime 中提取星期几的缩写名称?
ej:
DateTime date = DateTime.now();
String dateFormat = DateFormat('dd-MM-yyyy hh:mm').format(date);
结果 -> 周五
最佳答案
使用“E”作为日期模式(ABBR_WEEKDAY 模式)
DateFormat(DateFormat.ABBR_WEEKDAY).format(date);
查看更多信息:https://docs.flutter.io/flutter/intl/DateFormat-class.html
关于flutter - 如何在 Dart 中获取星期几的缩写名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64857603/