Sorting "datetime" with Typesense
TLDR em1nos asked about sorting "datetime" type in Typesense. Kishore Nallan suggested storing it as an int64 value.
Powered by Struct AI
1
3
30mo
Aug 01, 2021 (30 months ago)
em1nos
em1nos
11:48 AMsorting a "datetime" .. I guess we need to store it as a unix timestamp to be able to sort it?
Kishore Nallan
Kishore Nallan
11:49 AMCorrect. Typesense does not have a datetime type, so you have to store it as a int64 value.
em1nos
em1nos
11:49 AMthanks
1
Typesense
Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI
Indexed 3015 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
14mo
Handling Javascript Date Types
gab asked for advice on handling Javascript date types, and Jason recommended using a unix timestamp int64 field.
3
31mo
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
13mo