API:TimeUtils.ParseSeconds

From TheWarWiki

Jump to: navigation, search
Parent: TimeUtils - Return to API listing


No description available.

Usage

This function has not yet had its usage documented.

This method does not take any known arguments.

This method does not return any known values.

Source Code

function TimeUtils.ParseSeconds(time)
    if not (time > 0) then
        time = 0
    end
    
    time = math.floor( time + 0.9 )
    local secs = time % TimeUtils.SECONDS_PER_MINUTE 
    time = math.floor( time / TimeUtils.SECONDS_PER_MINUTE )
    local mins = time % TimeUtils.MINUTES_PER_HOUR 
    time = math.floor( time / TimeUtils.MINUTES_PER_HOUR )
    local hours = time % TimeUtils.HOURS_PER_DAY 
    local days = math.floor( time / TimeUtils.HOURS_PER_DAY )
    
    return secs, mins, hours, days
end
--Upload by Lliane, <sdepiets@gmail.com> 2008/08/21


Personal tools