[英]Date time format : what is the format called?
想知道這是什么類型的日期格式: 2022-08-12T01:47:24.856316
, 2022-09-15T08:32:38.490Z
以及如何將當前時間實現為這種格式。
該格式稱為ISO 8601 ,您可以像這樣解析和格式化它:
void main() {
print(DateTime.parse('2022-08-12T01:47:24.856316'));
print(DateTime.parse('2022-09-15T08:32:38.490Z'));
print(DateTime.now().toUtc().toIso8601String());
}
Output:
2022-08-12 01:47:24.856
2022-09-15 08:32:38.490Z
2023-01-28T07:28:29.865Z
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.