Method code for $time.dhms()

[Turn on line numbering]
arg secs, @long;
var ret_str, x;

if (long)
    long = 1;
if (secs > 86400) {
    x = secs / 86400;
    ret_str = x + (long ? " day" + (x < 2 ? "" : "s") : "d");
} else if (secs > 3600) {
    x = secs / 3600;
    ret_str = x + (long ? " hr" + (x < 2 ? "" : "s") : "h");
} else if (secs > 60) {
    x = secs / 60;
    ret_str = x + (long ? " min" + (x < 2 ? "" : "s") : "m");
} else {
    ret_str = secs + (long ? " sec" + (secs < 2 ? "" : "s") : "s");
}
return ret_str;

["// Created 26-Mar-1995 as a part of ColdCore, see: @help Credit"]

the Cold Dark