From 7fe56712a4d4338cfb23d13e1ec3c6264a3e450e Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 24 Nov 2013 04:38:40 -0500 Subject: [PATCH] doc/index: Improve get_tz documentation around timezone_name --- doc/index.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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). -- 2.39.2