Date Time Module

1. Variables

1.1. LPEG Grammars

  • date_fullyear - 4 digit year
  • date_month - 2 digit month
  • date_mabbr - month abbreviation to a numeric string
  • date_mfull - month name to a numeric string
  • date_mday - 2 digit month day (zero padded)
  • date_mday_sp - 2 digit month day (space padded)
  • time_hour - 2 digit hour
  • time_minute - 2 digit minute
  • time_second - 2 digit second (including leap second)
  • time_secfrac - fraction seconds
  • timezone - timezone abbreviations (US and UTC others create an offset of 0)
  • timezone_offset - numeric time zone offset
  • clf_timestamp - common log format timestamp
  • mysql_timestamp - MySQL timestamp
  • pgsql_timestamp - Postgres timestamp
  • rfc3164_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

results matching ""

    No results matching ""