有人知道我如何从DateTime中提取星期几的名称吗?
EJ:
DateTime date = DateTime.now();
String dateFormat = DateFormat('dd-MM-yyyy hh:mm').format(date);
Result -> Friday
有人知道我如何从DateTime中提取星期几的名称吗?
EJ:
DateTime date = DateTime.now();
String dateFormat = DateFormat('dd-MM-yyyy hh:mm').format(date);
Result -> Friday
使用"EEEE"作为约会模式
DateFormat('EEEE').format(date); /// e.g Thursday
别忘了导入
import 'package:intl/intl.dart';
有关更多信息,请查看以下内容:https://pub.dev/documentation/intl/latest/intl/DateFormat-class.html