How to format "NOW" to UTC when adding a record

Options

The image is pretty explanatory, im trying to format "NOW" to human readable format. when i debug its showing a different format

What did i miss ?

Tagged:

Best Answer

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Answer ✓
    Options

    The "created_at" field in the database is a timestamp, not a string. That means under the covers it is always saved as a number (as it happens, the number of milliseconds since January 1, 1970 in Greenwich, England, a quantity that is about 1.6 trillion). Xano thinks it is doing you a favor by taking that string you set up and converting it back to the timestamp number it stores.

    If you want to store the date separately, you will want a different field of type "date" or "text" to store your human-readable version. But most likely you just want to make sure that when a user pulls your record, they get something useful delivered to their front-end. Handling that at the endpoint where they retrieve the call is a best practice.

    Dates are hard! And a common subject in our community and daily office hours at Statechange.ai.

Answers