Fandom

WoWWiki

API SecondsToTimeAbbrev

104,634pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.


WoW API < SecondsToTimeAbbrev
Icon-information-22x22This function is implemented by FrameXML in [DEPRECATED http://wowprogramming.com/utils/xmlbrowser/live/FrameXML/UIParent.lua FrameXML/UIParent.lua].


TimeFormat, Value = SecondsToTimeAbbrev(TimeDuration);

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


Parameters Edit

Arguments Edit

TimeDuration 
Number - The amount of time to convert.

Returns Edit

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 Edit

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 Edit

30 s
15 m
1 h
1 d

Details Edit

Also on Fandom

Random Wiki