X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/e0c28e4f708567d7183cb6333f681ed8d32aa09a..ac89c4c58d68776dfec1a54c19077a58f1eb76c6:/doc/index.md diff --git a/doc/index.md b/doc/index.md index 89cea69..e0ece6a 100644 --- a/doc/index.md +++ b/doc/index.md @@ -8,21 +8,39 @@ The table includes the following sub modules, which have their own documentation - `timetable`: Class for date/time objects supporting normalisation -## `time ( )` +### `time ( )` -Returns the current unix timestamp using the most accurate source available. +Returns the current unix timestamp using the most precise source available. See `gettime` for more information. +### `now ( )` -## `get_tz ( timezone_name )` +Returns the current time as a timetable object +See `timetable` for more information + + +### `get_tz ( [timezone_name] )` Returns a timezone object (see `tzinfo` documentation) for the given `timezone_name`. +If `timezone_name` is `nil` then the local timezone is used. +If `timezone_name` is an absolute path, then that `tzinfo` file is used + This uses the local [zoneinfo database](https://www.iana.org/time-zones); -names are usually of the form `Country/Largest_City`. +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] )` + +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). + + +## As in the C standard library + +### `gmtime ( ts )` + +### `localtime ( ts )` + +### `ctime ( ts )` -Returns the current time in seconds since 1970-01-01 0:00:00 in the given timezone -(as a string, e.g. "America/New_York") at the given UTC time (defaults to now).