Update README.md

This commit is contained in:
Dmitry Melnikov 2013-01-23 18:55:23 +04:00
parent c9aa1b9c09
commit 21d6f848db

View file

@ -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"}