Soenneker.TimeZones.Lookup 4.0.98

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.TimeZones.Lookup --version 4.0.98
                    
NuGet\Install-Package Soenneker.TimeZones.Lookup -Version 4.0.98
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.TimeZones.Lookup" Version="4.0.98" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.TimeZones.Lookup" Version="4.0.98" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.TimeZones.Lookup" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.TimeZones.Lookup --version 4.0.98
                    
#r "nuget: Soenneker.TimeZones.Lookup, 4.0.98"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.TimeZones.Lookup@4.0.98
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.TimeZones.Lookup&version=4.0.98
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.TimeZones.Lookup&version=4.0.98
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.TimeZones.Lookup

Resolves latitude and longitude coordinates to IANA time-zone identifiers using a packaged GeoJSON boundary dataset.

Installation

dotnet add package Soenneker.TimeZones.Lookup

The lookup package references Soenneker.TimeZones.Data, so the default boundary resource is included automatically.

Registration

using Soenneker.TimeZones.Lookup.Registrars;

builder.Services.AddTimeZoneLookupUtilAsSingleton();

The singleton registration is recommended for most applications because the parsed geographic features are loaded once and retained for later lookups. A scoped registrar is available when isolation is more important than repeating that memory and parse cost per scope.

Usage

using Soenneker.TimeZones.Lookup.Abstract;

public sealed class LocationService(ITimeZoneLookupUtil timeZones)
{
    public ValueTask<string?> GetZone(
        double latitude,
        double longitude,
        CancellationToken cancellationToken = default)
    {
        return timeZones.GetTimeZoneId(latitude, longitude, cancellationToken);
    }
}

string? zone = await locationService.GetZone(41.8781, -87.6298);
// America/Chicago

Pass latitude first and longitude second. Latitude must be from -90 through 90 and longitude from -180 through 180; invalid values throw ArgumentOutOfRangeException. A valid coordinate returns null when no dataset polygon contains it, such as an uncovered ocean coordinate.

Loading behavior

The first lookup parses the GeoJSON and caches the resulting features for that TimeZoneLookupUtil instance. Concurrent callers share that initialization. Cancellation can stop the initial load; once loaded, lookups operate on the in-memory geometry.

The public constructor overload accepting a stream factory supports a custom GeoJSON dataset. The factory must return a readable stream containing a FeatureCollection; the loader owns and disposes the returned stream after parsing. Features use properties.tzid and Polygon or MultiPolygon geometry.

Coordinates on a polygon edge count as contained. If the dataset contains overlapping zones, the first matching feature determines the result.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.TimeZones.Lookup:

Package Downloads
Soenneker.ZipCodes.Lookup

Fast ZipCode Resolution for .NET

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.102 0 9/1/2026
4.0.101 0 9/1/2026
4.0.100 0 8/31/2026
4.0.99 0 8/31/2026
4.0.98 20 8/31/2026
4.0.97 30 8/31/2026
4.0.96 50 8/30/2026
4.0.95 43 8/30/2026
4.0.94 48 8/30/2026
4.0.93 46 8/29/2026
4.0.92 44 8/29/2026
4.0.91 109 8/28/2026
4.0.90 73 8/26/2026
4.0.89 50 8/26/2026
4.0.88 52 8/26/2026
4.0.87 128 8/22/2026
4.0.86 97 8/22/2026
4.0.85 97 8/22/2026
4.0.84 89 8/21/2026
4.0.83 116 8/21/2026
Loading failed