Date Time Module
1. Variables
1.1. LPEG Grammars
date_fullyear
- 4 digit yeardate_month
- 2 digit monthdate_mabbr
- month abbreviation to a numeric stringdate_mfull
- month name to a numeric stringdate_mday
- 2 digit month day (zero padded)date_mday_sp
- 2 digit month day (space padded)time_hour
- 2 digit hourtime_minute
- 2 digit minutetime_second
- 2 digit second (including leap second)time_secfrac
- fraction secondstimezone
- timezone abbreviations (US and UTC others create an offset of 0)timezone_offset
- numeric time zone offsetclf_timestamp
- common log format timestampmysql_timestamp
- MySQL timestamppgsql_timestamp
- Postgres timestamprfc3164_timestamp
rfc3339_time_numoffset
rfc3339_time_offset
rfc3339_partial_time
rfc3339_full_date
rfc3339_full_time
rfc3339
2. Functions
2.1. build_strftime_grammar
Constructs an LPEG grammar based on the strftime format.
Arguments
- strftime (string) - strftime format specifier
Return
- grammar (LPEG user data object) or an error is thrown
2.2. time_to_ns
Converts time table to a time_ns
Arguments
- t (table) - table returned by the various date/time grammars
Return
- time_ns (number) - number of nanoseconds since the Unix epoch
2.3. seconds_to_ns
Converts time_t to a time_ns
Arguments
- time_t
Return
- time_ns (number) - number of nanoseconds since the Unix epoch
source code: date_time.lua