From: daurnimator Date: Sun, 24 Nov 2013 09:38:40 +0000 (-0500) Subject: doc/index: Improve get_tz documentation around timezone_name X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/7fe56712a4d4338cfb23d13e1ec3c6264a3e450e?ds=sidebyside doc/index: Improve get_tz documentation around timezone_name --- diff --git a/doc/index.md b/doc/index.md index 89cea69..d12f09b 100644 --- a/doc/index.md +++ b/doc/index.md @@ -14,15 +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`. +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`. +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).