What is the formula to convert timestamp to days ago?

Options

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

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

    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