From 21d6f848db44327c70566d482eda164609c47dd1 Mon Sep 17 00:00:00 2001 From: Dmitry Melnikov Date: Wed, 23 Jan 2013 18:55:23 +0400 Subject: [PATCH] Update README.md --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 1f80aba..39aa61f 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,30 @@ DateTime = {date(), time()} TimeZone(To, From) = String(). E.g. “Europe/Moscow”, “America/NewYork”. Or abbreviations "MSK", "MSD", etc. Note: abbreviation is just used to find appropriate timezone name. If you want to convert "MSK" -> "PDT", but source timezone is not in daylight saving, it will be corrected by library and "MSK" -> "PST" conversion will be made. + +#### Examples of usage + +Convert UTC time to local one + +>localtime:utc_to_local({{2010, 7, 22}, {17, 56, 23}, "Europe/Moscow"). +> +>{{2010,10,10},{21,56,23}} + +Convert local time to UTC one +>localtime:local_to_utc({{2010, 10, 10}, {21, 56, 23}}, "Europe/Moscow"). +> +>{{2010,10,10},{17,56,23}} + +Convert time from one local timezone to another local one +>localtime:local_to_local({{2010, 10, 10}, {21, 56, 23}}, "Europe/Moscow", "Australia/Sydney"). +> +>{{2010,10,11},{3,56,23}} + +Return timezone name +>localtime:tz_name({{2010, 10, 10}, {21, 56, 23}}, "Europe/Moscow"). +> +>{"MSK","MSK"} + +>localtime:tz_name({{2010,10,11},{3,56,23}}, "Australia/Sydney"). +> +>{"EST","EST"}