Getting time since timestamp

Hi all,

I’m trying to format my date to something like below:

example

How does JIRA calculate and format dates like the image above?
Is there a simple way to do this programatically? or would I have to calculate it?

I’ve discovered JiraDurationUtils but I’m not sure if this is what I’m looking for.
Any advice would be appreciated.

Hi @sanjit.kosi,

Not sure how Jira does it, but here’s how we do it:

In Javascript, I would recommend moment.js: https://momentjs.com/docs/#/displaying/fromnow/ . In Java, we’re not using anything, but it looks like https://github.com/mfornos/humanize#datetime-1 does what you want.

Cheers,
Tobi