Help on editing and updating unix epoch time fields - Retool app

I have a column on my table that stores data in unix epoch time format.

I use the Datetime format to render it in a readable form for users, but I also want to make the field editable.

How do I ensure it stays in a readable form while also being editable?

Hey @P4G_Developers! This should be possible as the conversion from unix epoch => JS Date object and vice versa is pretty straight forward.

I'm assuming you have the table mapped already to the proper Date with the Date column. Which should allow the users to simply select a date from the Date input when they edit it.

Your update query needs to then take that date and convert it back to a unix epoch timestamp before updating the underlying DB entry. This code should work:

Let me know if that works for you!