Handling Javascript Date Types
TLDR gab asked for advice on handling Javascript date types, and Jason recommended using a unix timestamp int64 field.
Powered by Struct AI
3
3
29mo
Solved
Jul 09, 2021 (29 months ago)
gab
gab
05:03 PMHow should I handle a javascript date type. I have set the type as 'auto'. Should it be converted to string or a timestamp number instead? I would like to performs operation on it like sorting so I might put a timestamp?
1
Jason
Jason
05:13 PMIf you want to sort by date, storing it as a unix timestamp int64 field is best
gab
gab
05:17 PMOk thanks I found this https://github.com/typesense/typesense/issues/182#issuecomment-759928470 :thumbsup:
2
Typesense
Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI
Indexed 2786 threads (79% resolved)
Similar Threads
Sorting Data by Date Range in Typesense
Aravinda asked about sorting data using Typesense. Jason suggested using Unix timestamp, then sorting by that field. Aravinda experienced difficulties implementing this.
3
12mo
Sorting "datetime" with Typesense
em1nos asked about sorting "datetime" type in Typesense. Kishore Nallan suggested storing it as an int64 value.
3
28mo
Solved
Converting Firestore Timestamps to Dates in Typesense
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.
4
11mo
Solved