The $duration identifier can take a specified number of seconds and return it in weeks/days/hours/minutes/seconds format. After a value has been returned, the new value can even be used with the identifier in order to return the number of seconds.
seconds The specific number of seconds to get the formatting for
N Can be either 2, which omits seconds from the results, or 3, which returns the time in hh:nn:ss format Beginning v7.63 correctly handles negative durations.
Echo the formatting for 38711810 seconds:
64wks 1hr 16mins 50secs
Same except does not display the seconds. Result
64wks 1hr 16mins
Returns the display in HH:nn:ss format, with durations longer than 1 day returning hours > 23. Result
Echo the formatting for converting 64wks 1hr 16mins 50secs back to seconds:
The displayed timestring contains the time units touching their integers, so you will need to use $replace if you don't wish this:
//echo -a This computer restarted $regsubex(foo,$duration($uptime(system,3)),/([a-z]+)/g,$chr(32) $+ \t) ago!
Added: mIRC v4.7
Added on: 09 Dec 1996
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.