mIRC Homepage

$duration negative numbers

Posted By: maroon

$duration negative numbers - 26/04/20 03:07 PM

ETA or timing in various sports are often output in one of the $duration formats, and are often expressed as negative numbers. However, $duration does not currently support negative numbers:

Code
//echo -a $duration(-12345,3)
now: 00:00:-12345
new: -03:25:45

//echo -a $duration(-12345)
now: -12345secs
new: -3hrs 25mins 45secs

//echo -a $duration(-12345,2)
now: -12345secs
new: -3hrs 25mins

translating back to integer:

//echo -a $duration(-03:25:45)
now: -9255
new: -12345

//echo -a $duration(-12345secs)
now: 0
new: -12345

//echo -a $duration(-3hrs 25mins 45secs)
now: 1545
new: -12345
© 2020 mIRC Discussion Forums