# $EPIC: tdiff.txt,v 1.2 2006/08/20 17:37:08 sthalik Exp $
$tdiff(<seconds>)
$tdiff2(<seconds>)
If <tday> is 0, then nothing If <tday> is 1, then "1 day " Otherwise, then "<tday> days " plus If <thour> is 0, then nothing If <thour> is 1, then "1 hour " Otherwise, then "<thour> hours " plus If <tmin> is 0, then nothing If <tmin> is 1, then "1 minute " Otherwise, then "<tmin> minutes " plus If <tsec> is not zero or all of <tday>, <thour>, <tmin> are zero, or <after> exists, then If <after> exists, <sec> is "<tsec>.<after>" then "<sec> seconds" If <tsec> is 1, then "<sec> second" Otherwise, then "<sec> seconds"
These functions are useful for showing how much time has elapsed since a particular event. For instance, they can convert your idle time from the number of seconds to a more readable form.
A human readable string representing some elapsed time.
This function first appeared in ircII-2.2pre5
$tdiff(248576) returns "2 days 21 hours 2 minutes 56 seconds" $tdiff(-248576) returns "-2 days -21 hours -2 minutes -56 seconds" $tdiff2(248576) returns "2d 21h 2m 56s" $tdiff2(-248576) returns "-2d -21h -2m -56s" $tdiff2(3602) returns "1h 2s" Notice the absence of minutes.