Detailed "ago" php function

Hello.
I have a function in my website that converts date to “ago” format.
it displayes “registered 1 hour ago” , " 1 year ago" etc…

I want it to show more details, for example:
“1 year and 3 months ago”

How I can do this?

Can you post the code of the function you have already, so people can see how it could be changed?

You’ll want to look at the PHP DateTime function, if you aren’t already.

(Class. DateTime class ;P)

Specifically, Ryan is probably recommending you look at DateTime’s diff() function…

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.