What is the best Datatype for Date and Time

I want to start recording timestamps for changes/updates in my MySQL DB.

What is the best datatype to use with retool so that the modules work correctly with the timestamp so that I do not have to do any converting.

DATE
DATETIME()
TIME()
TIMESTAMP()

what datatype does retool use natively?

Hi @MacD87

Thanks for reaching out!

We try to do a pretty good job of automatically working with dates & times from SQL. For example, each of the types you've listed above automatically work in the table component--you just may need to set up the Manage time zone section:

In the time component, the datetime and timestamp both worked well. I only had to make one change, which was to set up the Manage timezone section:

Our docs mention that it can be useful to consistently save values in UTC and use local time zones only for display.

Besides the UTC recommendation, I would recommend just choosing the datatype that makes the most sense for you & your use case. We also include the https://momentjs.com/ library inside of retool by default, which is really helpful for manipulating dates and times.