Wikia

WoWWiki

API SecondsToTimeAbbrev

Talk0
102,281pages on
this wiki
Revision as of 19:50, June 7, 2008 by Curtwulf (Talk | contribs)

(diff) ←Older revision | Latest revision (diff) | Newer revision → (diff)
WoW API < SecondsToTimeAbbrev
Icon-information-22x22This function is implemented by FrameXML in FrameXML/UIParent.lua.


TimeFormat, Value = SecondsToTimeAbbrev(TimeDuration);

Converts an amount of time (TimeDuration) into a formatted string (TimeFormat) and value.


Parameters

Arguments

TimeDuration 
Number - The amount of time to convert.

Returns

TimeFormat 
String - A string in the format "%d s|m|h|d"
Value 
Number - The seconds, minutes, hours, or days that will fit into the formated string.


Example

Results below, respectively

local msg, val = SecondsToTimeAbbrev(30)
output = format(msg, val)
DEFAULT_CHAT_FRAME:AddMessage(output)
local msg, val = SecondsToTimeAbbrev(900)
output = format(msg, val)
DEFAULT_CHAT_FRAME:AddMessage(output)
local msg, val = SecondsToTimeAbbrev(3600)
output = format(msg, val)
DEFAULT_CHAT_FRAME:AddMessage(output)
local msg, val = SecondsToTimeAbbrev(86400)
output = format(msg, val)
DEFAULT_CHAT_FRAME:AddMessage(output)

Result

30 s
15 m
1 h
1 d

Details

Around Wikia's network

Random Wiki