Update README.md
This commit is contained in:
parent
c9aa1b9c09
commit
21d6f848db
1 changed files with 27 additions and 0 deletions
27
README.md
27
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:
|
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
|
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.
|
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"}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue