Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArgToTime ¶
ArgToTime converts the n-th argument to a time. If the value is nil then the current time will be returned; if the value is an integer then it will be assumed to represent a UNIX time; if the value is a table then TableToTime will be used to perform the conversion.
Note that the returned time will be given in the location determined by Location.
func Date ¶
Date returns a Lua value corresponding to the given time and format.
Note that the formatting will take place relative to the location determined by Location, unless the first character in the format string is "!", in which case UTC is used for the location.
func Location ¶
Location returns the current location for date/time operations, as set by the os.setlocale function.
func TableToTime ¶
TableToTime convert the given table v to a time. The table may have fields:
year (required) month (1–12) (required) day (1–31) (required) hour (0–23) (default: 12) min (0–59) (default: 0) sec (0–61) (default: 0) millisec (0-999) (default: 0)
If any required field is missing or nil, then an error will be returned. The values for month, day, hour, min, and sec may be outside their usual ranges and will be normalised during the conversion. For example, October 32 converts to November 1.
Note that the conversion will take place relative to the location determined by Location.
func TimeToTable ¶
TimeToTable converts the given time to a table. The following fields will be set on the returned table:
year month (1–12) day (1–31) hour (0–23) min (0–59) sec (0–61) millisec (0-999) wday (weekday, 1–7, Sunday is 1) yday (day of the year, 1–366)
Note that the conversion will take place relative to the time's location. If you need this to be relative to the location set by the user, do
TimeToTable(when.In(Location(t)))
where t is the current thread.
Types ¶
This section is empty.