Provides an IANA time zone identifier from latitude and longitude coordinates.
PM> Install-Package GeoTimeZone
As of version 3.0.0, this library is targeting .NET Standard 1.1+, .NET Standard 2.0+, and .NET Framework 4.0+.
As of version 4.1.0, an additional target for .NET Standard 2.1 is added, which improves runtime performance by leveraging
ReadOnlySpan<T> in its internals.
(This version will be used when your app targets .NET Core 3.0 or newer.)
See the .NET Standard Platform Support Matrix for further details.
string tz = TimeZoneLookup.GetTimeZone(50.4372, -3.5559).Result; // "Europe/London"
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.
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!
This library is provided free of charge, under the terms of the MIT license.