Reputation: 69
Can anyone help mw with writing a timestamp from google script to firestore. When I use "new Date()" in google script, it store as an empty map in firestore. If I stringify the Date, it stores as a String firestore, But i need this attribute to store a Timestamp.
Upvotes: 2
Views: 474
Reputation: 11
To save as a timestamp, just make sure your date is actually a date
, and not a String
. I used DATEVALUE
to convert my String
to a date, then I let this library (FirestoreGoogleAppsScript) to take care of the rest.
Upvotes: 1