mattjohnsonpint / GeoTimeZone

Provides an IANA time zone identifier from latitude and longitude coordinates.
Other
227 stars 40 forks source link

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:

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:

License

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