【发布时间】:2020-08-06 03:44:28
【问题描述】:
var birthDate= DateFormat('yyyy/M/dd').parse(tempBirthDate);
print(birthDate);
String dtStringBday = DateFormat('yyyy-MM-dd').format(birthDate);
//print result: 1967-08-16 00:00:00.000
您好,我正在使用此代码来解析和格式化我的日期。但我在我的 android 版本 6.0.1 SamsungJ7 上出现此错误Error: FormatException: Trying to read yyyy from at position 0,但在我的三星 A8 android 版本 7.1.1 中没有。 android版本会影响日期解析吗?还是我做错了什么?
【问题讨论】:
标签: android flutter dart date-parsing