viewing paste time2str | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13
function    script  Time2Str    {
        .@left = getarg(0) - gettimetick(2);
        //.@left = gettimetick(2) + (86400*2+123456) - gettimetick(2);
        setarray .@str$, "day","hour","minute","second";
        .@day = .@left / 86400;
        .@hour = .@left % 86400 / 3600;
        .@minute = .@left % 86400 % 3600 / 60;
        .@second = .@left % 86400 % 3600 % 60;
        .@size = getarraysize(.@str$);
        for (.@i = 0; .@i < .@size; .@i++)
            .@time$ = .@time$ + (.@t = getd(".@" + .@str$[.@i])) + " " + .@str$[.@i] + ((.@t > 1)?"s":"") + ((.@i != .@size - 1)?", ":"");
        return .@time$;
    }
Viewed 666 times, submitted by jtkay.