In Firestore, I have a document with a field of type array, I want to add datetime values to it from flutter app. Can anyone suggest a way to do it?
In Firestore, I have a document with a field of type array, I want to add datetime values to it from flutter app. Can anyone suggest a way to do it?
Storing:
Use DateTime.now().millisecondsSinceEpoch
This would give you an int value in return that you can save in Firestore.
Retrieving:
You can easily get DateTime from the saved value using DateTime.fromMillisecondsSinceEpoch(valueSavedInFirestore)