Navigation menu

WoW:API date: Difference between revisions

Jump to navigation Jump to search
20 bytes removed ,  25 March 2010
{{luaapi}}
(added link to GetGameTime)
({{luaapi}})
Line 1: Line 1:
{{wowapi}}
{{luaapi}}
date() is a reference to the os.date function. It is put in the global table as the os module is not available.
  date ([format [, time]])
  date ([format [, time]])


date() is a reference to the os.date 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 [[API_time|time]] represented by <tt>time</tt>), formatted according to the given string <tt>format</tt>.  If one wishes to supply your own format string, then it uses the same rules as [http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html strftime()].  The special string <tt>*t</tt> tells the <tt>date()</tt> function to return a table.
It returns a string or a table containing the user's machine's current date and time (or the [[API_time|time]] represented by <tt>time</tt>), formatted according to the given string <tt>format</tt>.  If one wishes to supply your own format string, then it uses the same rules as [http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html strftime()].  The special string <tt>*t</tt> tells the <tt>date()</tt> function to return a table.
Line 19: Line 19:


== Also see ==
== Also see ==
* [[API GetGameTime|GetGameTime()]]
* {{api|GetGameTime}}()
{{LUA}}