Forum OpenACS Q&A: distance of time "in words"

Collapse
Posted by Michael Cordova on
Hello,

I wonder if someone has developed a function to show distance of time in words.

If not, where is supposed to be written this function? I think, it should be in some acs-* package due to its importance and re-usability.

I think it's very useful for people to see a "relative" date or time, instead of (always) a "human" readable date format, for instance...
- in words: about an hour
- human readable: 1st jun 2007 12:20

In forums, file-storage, last visit and so on... it could be nice to see a "time in words" sentence if possible... "Two hours ago, a week ago, more than one year ago..."

Collapse
Posted by Gustaf Neumann on
Look at ::util::age_pretty, and for a usage e.g. in xowiki's weblog https://openacs.org/xowiki/weblog in the weblog titles or in the presence module, where it says who was visiting the weblog in the last n minutes.
Collapse
Posted by Patrick Giagnocavo on
If the age_pretty util doesn't do what you want, I suggest searching on http://wiki.tcl.tk for TCL snippets that may serve your need.

See for example, http://wiki.tcl.tk/591 for various time/number spellers.