Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API SecondsToTime

Last wiki revision 2022-05-19

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.

  • seconds : - The number of seconds to be represented.
  • noSeconds : - If true, seconds are omitted from the output.
  • timePassed : - Formatted, localized string representing the specified number of seconds.

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

5461 seconds is approximately 1 Hr 31 Mins

  • 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.

Source

https://warcraft.wiki.gg/wiki/API_SecondsToTime · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.