API date

Revision as of 02:47, July 15, 2009 by Watchout (Talk | contribs)

103,155pages on
this wiki
WoW API < date
date ([format [, time]])

date() is a reference to the function. It is put in the global table as the os module is not available.

It returns a string or a table containing the user's machine's current date and time (or the time represented by time), formatted according to the given string format. If one wishes to supply your own format string, then it uses the same rules as strftime(). The special string *t tells the date() function to return a table.

This is a mirror of the LUA function

Note that the default format returned when calling the date() function with no parameters will be different depending on whether the game is running on a PC or a Macintosh computer. If you want your addon to be compatible with both systems, you should therefore not use date() without parameters, instead, use

date("%m/%d/%y %H:%M:%S")

to display the date in the default PC format


date("%a %b %d %H:%M:%S %Y")

to display the date in the default Macintosh format

Also see


Around Wikia's network

Random Wiki