How to format "NOW" to UTC when adding a record
![liam](https://us.v-cdn.net/6037124/uploads/userpics/3H7104LQR226/nMYKMXK20IPV2.png)
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 ?
Best Answer
-
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
-
@Ray Deck thank you!
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback