我正在从api中以这种格式检索日期,例如"2020-03-02".
,但是我需要以这种格式来呈现日期,例如"Tuesday, March,2020"
。我一直无法找到 flutter 朔迷离的解决方案。有什么帮助吗?
最佳答案
使用intl插件
print(DateFormat('EEEE, MMM, yyyy').parse(dateString)); // prints Tuesday, mar, 2020
//OR
print(DateFormat('yyyy, MMM, EEEE').parse(dateString)); // prints 2020, mar, Tuesday
关于date - 更改 Dart 上的日期格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60674028/