X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/86473212afa1a64fa691d4562902e916538dd47a..d431ae6abaf5b0814389f2adf6069915d2e983c2:/doc/index.md?ds=inline diff --git a/doc/index.md b/doc/index.md index 6c08c24..d12f09b 100644 --- a/doc/index.md +++ b/doc/index.md @@ -14,13 +14,17 @@ Returns the current unix timestamp using the most accurate source available. See `gettime` for more information. -## `get_tz ( timezone_name )` +## `get_tz ( [timezone_name] )` Returns a timezone object (see `tzinfo` documentation) for the given `timezone_name`. -This uses the local zoneinfo database; names are usually of the form `Country/Largest_City`. +If `timezone_name` is `nil` then the local timezone is used. + +This uses the local [zoneinfo database](https://www.iana.org/time-zones); +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] )` -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). +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).