#community-help

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
Join the chat
Jul 09, 2021 (29 months ago)
gab
Photo of md5-8be2a24edf7a95c9c74abce4b1130c3e
gab
05:03 PM
How 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
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:13 PM
If you want to sort by date, storing it as a unix timestamp int64 field is best
gab
Photo of md5-8be2a24edf7a95c9c74abce4b1130c3e