Forums / General / Converting dates to "time ago"

Converting dates to "time ago"

Author Message

Deane Barker

Tuesday 31 July 2007 2:36:31 pm

I'm looking for a template operator that will take a date and convert it to "time ago." So it would take something like --

07/31/2007 11:34 AM

-- and convert it to something like this --

"Three hours ago"

Does anyone know of anything like this? I looked through the contributions, but didn't find anything.

André R.

Wednesday 01 August 2007 1:38:35 am

if you convert it to unix timestamp(the internal format used for date and date & time datatype) you can subtract it from current time to get how many seconds they diff.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom