WhereTZ v0.1.13 WhereTZ View Source
WhereTZ is Elixir version of Ruby gem for lookup of timezone by georgraphic coordinates.
Example
iex(1)> WhereTZ.lookup(50.004444, 36.231389)
"Europe/Kiev"
iex(2)> WhereTZ.get(50.004444, 36.231389)
#<TimezoneInfo(Europe/Kiev - EET (+02:00:00))>
Link to this section Summary
Link to this section Functions
Link to this function
get(lat, lng)
View Sourceget(-90..90, -180..180) :: Timex.TimezoneInfo.t() | nil
Timex.TimezoneInfo object by coordinates.
- lat Latitude (floating point number)
- lng Longitude (floating point number)
@return Timex.TimezoneInfo
Example
iex(1)> WhereTZ.get(50.004444, 36.231389)
#<TimezoneInfo(Europe/Kiev - EET (+02:00:00))>
Time zone name by coordinates.
- lat Latitude (floating point number)
- lng Longitude (floating point number)
@return {String, nil, Arraynil
if no time zone corresponds
to (lat, lng); in rare (yet existing) cases of ambiguous timezones may return an array of names
Example
iex(1)> WhereTZ.lookup(50.004444, 36.231389)
"Europe/Kiev"