【问题标题】:How to send custom date to firestore in flutter如何在颤动中将自定义日期发送到 Firestore
【发布时间】:2021-10-09 14:17:01
【问题描述】:

我想将日期发送到 Firestore 时间戳字段。我不想使用 timestamp.now()。日期应该是用户选择的日期。 例如在firestore中它应该看起来像

出生日期:1946 年 6 月 4 日凌晨 12:00:00 UTC+5:30

【问题讨论】:

    标签: firebase flutter dart google-cloud-firestore timestamp


    【解决方案1】:

    您可以利用 DateTime 类中包含的 toIso8601String 方法 (docs)。 Firebase 喜欢这个标准。

    【讨论】:

      猜你喜欢
      • 2020-04-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-07
      • 2014-08-10
      • 2020-05-23
      相关资源
      最近更新 更多