Time and date wanted in days

Is it possible to create date in days instead of the standard date format? I am creating an App where people can post items but want the posted at time to be in days and not time.

Thank you

Using international standards will help you in case you want to integrate or analyze data. You can change how it looks to users by using formulas such as FORMAT_DATETIME_LOCAL or FORMAT_DATETIME_WITH_TIMEZONE

I’d recommend to use Date Time Text and format it, but you can also use Date Text.

What you mean by “days” would you provide some example?

Hi Alan,

Thank you for your response. So let’s say for instance, my app has to do with recycling and someone has a chair that he wants to give away and he posts the picture,

so I want to have it like this picture I posted, that will display ADDED X DAYS AGO instead of showing for example DD/MM/YYYY

Thank you

You may want to take a look at:

Social timeline card, as it has this functionality built in. It is in the component market.

Thank you so much. I will have a look at it and give it a try.


1 Like

For that, use the formula function DATETIME_DIFFERENCE and set the output to days. You’ll need first, to store the date the give-away product has been posted. In the formula you should have something like: DATETIME_DIFFERENCE(NOW(),POST_DATE, “days”). It will return a number which is the number of days is has passed since the product was posted.

1 Like

Hi Alan,

Thank you for helping me the last time. May i trouble you again if you don’t mind. I have used the DATETIME_DIFFERENCE formula to set the output in days and i have gotten the output in days

Inline image

but i want to have (d) at the end of the number e.g 5d. Now it only comes out as 5. Is there any way i can do that?

Secondly, the formula is showing like this when the paragraph is bound to the formula making it so distorted. Is there a way to make the paragraph to only show the output eg (Added 5d) instead of the whole formula.

Thank you

  1. You just have to add “d” to the your formula: ```"Added " + DATETIME_DIFFERENCE(NOW(), pageVars.repeated.current.created_at, “days”) + “d”````
  2. It won’t be distorted on the app preview and/or on the published app.

Thank you always Alan. No it is not distorted on the app preview. I just wasn’t sure if that should be showing.

Thank you again for the quick response.