Wikia

WoWWiki

API SecondsToTime

Talk0
100,551pages on
this wiki
Revision as of 15:04, August 19, 2009 by Dschiggs (Talk | contribs)

(diff) ←Older revision | Latest revision (diff) | Newer revision → (diff)


WoW API < SecondsToTime
Icon-information-22x22This function is implemented by FrameXML in FrameXML/UIParent.lua.


timePassed = SecondsToTime(seconds[, noSeconds]);
Is defined in UIParent.lua as: function SecondsToTime(seconds, noSeconds, notAbbreviated, maxCount)

Converts a number of seconds into a localized, user readable timespan.


Parameters Edit

Arguments Edit

seconds, noSeconds
seconds 
Number - The number of seconds to be represented.
noSeconds 
Boolean (optional) - If true, seconds are omitted from the output. (Omitting it == false)

Returns Edit

timePassed 
String - Formatted, localized string representing the specified number of seconds.


Example Edit

local timePassed = SecondsToTime(5461)
DEFAULT_CHAT_FRAME:AddMessage("5461 seconds is approximately " .. timePassed)

Result Edit

5461 seconds is approximately 1 Hr 31 Mins


Details Edit

Converts a number of seconds to a user readable timespan. The exact result differs for each client language.
Regardless of the noSeconds parameter, the function never returns more than two different time units of precision. i.e. if seconds is greater than 3600, seconds will be omitted. If it is greater than 86400, minutes will also be omitted.
Advertisement | Your ad here

Around Wikia's network

Random Wiki