WoW:API date: Difference between revisions

Use Lua/Libshortcut template. Change category from "LUA Functions" to "Lua functions".
No edit summary
(Use Lua/Libshortcut template. Change category from "LUA Functions" to "Lua functions".)
Line 1: Line 1:
<tt>date ([format [, time]])</tt>
{{:Lua/Libshortcut|date|os.date}}
 
date ([format [, time]])


It returns a string or a table containing the user's machine's current date and time (or the 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 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 7: Line 9:
If one supplies no arguments, it returns the current date and time formatted using the following string: <tt>%m/%d/%y %H:%M:%S</tt>
If one supplies no arguments, it returns the current date and time formatted using the following string: <tt>%m/%d/%y %H:%M:%S</tt>


{{Template:WoW API}}
{{LUA}}
Anonymous user