Skip to content

Provides an IANA time zone identifier from latitude and longitude coordinates.

License

Notifications You must be signed in to change notification settings

jnyrup/GeoTimeZone

This branch is 25 commits behind mattjohnsonpint/GeoTimeZone:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9c1d899 · Sep 6, 2022
Sep 3, 2022
Sep 6, 2022
Sep 6, 2022
Sep 6, 2022
Jan 31, 2014
Sep 3, 2022
Sep 3, 2022
Sep 3, 2022
Nov 5, 2017
Mar 16, 2021
Sep 6, 2022

Repository files navigation

GeoTimeZone NuGet Version

Provides an IANA time zone identifier from latitude and longitude coordinates.

Nuget Installation

PM> Install-Package GeoTimeZone

Supported Environments

As of version 5.0.0, GeoTimeZone works with all of the following:

  • .NET 5 or greater
  • .NET Core 2.0 or greater
  • .NET Framework 4.6.2 and greater

Note that .NET Framework versions less than 4.6.2 are no longer supported.

Example Usage

string tz = TimeZoneLookup.GetTimeZone(50.4372, -3.5559).Result;  // "Europe/London"

Usage Notes

This library returns IANA time zone IDs. If you need a Windows time zone ID, pass the return value into the TimeZoneConverter library's TZConvert.IanaToWindows method, or to TZConvert.GetTimeZoneInfo to get a TimeZoneInfo object in a platform-neutral manner.

This library uses the time zone border definitions from the Timezone Boundary Builder project, which in-turn derive from Open Street Map. As some international borders are the subject of dispute, the results may or may not align with your worldview. Use at your own risk.

Acknowledgements

Huge thank you to the following people:

  • Evan Siroky, who tirelessly maintains the Time Zone Boundary Builder project, which we use for our source data.
  • Eric Muller, who authored the original tz_world data set (now deprecated in favor of TBB).
  • Simon Bartlett, who contributed all the polygon indexing and lookup bits to this library.
  • Sharon Lourduraj, who wrote GeoHash-net that we used for our original implementation.
  • David Troy, who wrote Geohash-js that Sharon later ported to .NET
  • Nick Johnson, who's excellent blog post has been an inspiration to this project and so many others!
  • Jonas Nyrup, who has helped with performance optimizations.

License

This library is provided free of charge, under the terms of the MIT license.

About

Provides an IANA time zone identifier from latitude and longitude coordinates.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%