#community-help

Converting Firestore Timestamps to Dates in Typesense

TLDR Andrew asked about converting Firestore integer timestamps in Typesense back to dates. Jason and Kishore Nallan confirmed they're unix timestamps and suggested using a date formatting library.

Powered by Struct AI

1

Nov 07, 2022 (13 months ago)
Andrew
Photo of md5-7766f890de99fa72a6d81315691a6758
Andrew
05:53 AM
I noticed that when syncing firebase to typesense, timestamps from firestore are converted to integers. Is there any way to convert them back to a date clientside?
Jason
Photo of md5-c7ebbbcac16a1763e16d0e8e8177b0ae
Jason
06:04 AM
Are these not unix timestamps?
06:04
Jason
06:04 AM
I expect they are, if so, converting back should be straight forward.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
08:26 AM
Yes, Typesense does not have a date/time type so timestamps are stored as unix timestamp in int64 type. You can use any date formatting library to format it.

1