1

每个人我都在使用 MongoDB 作为我的后端,我不知道如何将DateTime 类型转换为ISODate MongoDB,我尝试查看文档和搜索,我找不到任何关于它的信息,你有什么想法吗?这个 ?预先感谢

4

1 回答 1

1

您可以使用如下代码将 dart DateTime 转换为 ISO8601Date 格式:

DateTime now = DateTime.now();
String isoDate = now.toIso8601String(); 
于 2021-11-22T08:09:53.523 回答