#community-help

Sorting Data by Date Range in Typesense

TLDR Aravinda asked about sorting data using Typesense. Jason suggested using Unix timestamp, then sorting by that field. Aravinda experienced difficulties implementing this.

Powered by Struct AI
Oct 26, 2022 (12 months ago)
Aravinda
Photo of md5-d4d095292cf7afb6c22ae0d5c4bbb50d
Aravinda
12:43 PM
@here can we sort the data based on date range in typesense ??
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:25 PM
Yup, you want to store the dates as Unix timestamp in an int64 field in Typesense, and then you can use sort by that numerical field using sort_by
Oct 27, 2022 (12 months ago)
Aravinda
Photo of md5-d4d095292cf7afb6c22ae0d5c4bbb50d
Aravinda
06:30 AM
hi Jason I had tried .but faced problem .this is the correct way ??