X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/4c342db811aa99e6438e6dd9dff4498e1dcbd87c..30a82a3ecf764b2349cde9755686b1109ebe4b2a:/doc/index.md diff --git a/doc/index.md b/doc/index.md index 2b7872d..68a3381 100644 --- a/doc/index.md +++ b/doc/index.md @@ -1,20 +1,25 @@ -# `luatz` +## `luatz` Requiring the base luatz module will give you a table of commonly used functions and submodules. The table includes the following sub modules, which have their own documentation: - - `parse`: Parses common date/time formats - - `timetable`: Class for date/time objects supporting normalisation + - [`parse`](#parse): Parses common date/time formats + - [`timetable`](#timetable): Class for date/time objects supporting normalisation - -### `time ( )` +### `time()` {#luatz.time} Returns the current unix timestamp using the most precise source available. -See `gettime` for more information. +See [`gettime`](#luatz.gettime) for more information. + + +### `now()` {#luatz.now} + +Returns the current time as a timetable object +See `timetable` for more information -### `get_tz ( [timezone_name] )` +### `get_tz([timezone_name])` {#luatz.get_tz} Returns a timezone object (see `tzinfo` documentation) for the given `timezone_name`. If `timezone_name` is `nil` then the local timezone is used. @@ -25,17 +30,22 @@ names are usually of the form `Country/Largest_City` e.g. "America/New_York". Check [wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for an example list. -### `time_in ( timezone_name [, utc_ts] )` +### `time_in(timezone_name[, utc_ts])` {#luatz.time_in} Returns the current time in seconds since 1970-01-01 0:00:00 in the given timezone as a string, -(same semantics as `get_tz`) at the given UTC time (defaults to now). +(same semantics as [`get_tz`](#luatz.get_tz)) at the given UTC time (defaults to now). + + +### `gmtime(ts)` {#luatz.gmtime} + +As in the C standard library -## As in the C standard library +### `localtime(ts)` {#luatz.localtime} -### `gmtime ( ts )` +As in the C standard library -### `localtime ( ts )` -### `ctime ( ts )` +### `ctime(ts)` {#luatz.ctime} +As in the C standard library