What is the formula to convert timestamp to days ago?
Options
![nelson artunduaga](https://us.v-cdn.net/6037124/user_avatars/5917594.jpg)
nelson artunduaga
Member ✭
I have the creation date in timestamp and I would like to change it to something like "created 2 days ago" how should I do it?
Tagged:
Best Answer
-
More than one way of doing this. One is to take the timestamp, subtract it from now, and then divide the difference by 86,400,000. That will give you the number of days. Use the round filter to get the nearest whole number (e.g 1.9 to 2). Then you can stick that in a string for "created X days ago" replace X with the quotient in question.
Answers
-
Ray thanks for helping me with this!
-
Thanks, this also helped me. It gave me a framework to work out the hours & minutes too. Thanks!
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