Convert UTC date/time values into country-specific time zones with simple extension methods.
$ dotnet add package Elmasry.UtcToCountryTimeZonesLibrary for converting UTC date/time values to a target country's time zone with simple extension methods.
dotnet add package Elmasry.UtcToCountryTimeZones
using Elmasry.UtcToCountryTimeZones.Enums;
using Elmasry.UtcToCountryTimeZones.Extensions;
var utcNow = DateTime.UtcNow;
// Convert UTC DateTime to a country's local time
var cairoTime = utcNow.ToTimeZone(Country.Egypt);
// Convert UTC DateTimeOffset to a country's local time
var tokyoTime = DateTimeOffset.UtcNow.ToTimeZone(Country.Japan);
Country enum includes 240+ countries/regions (ISO-based). Each maps to a representative Windows time zone.CountryTimeZoneIds to your preferred mapping.DateTime.Kind == Utc or DateTimeOffset.Offset == TimeSpan.Zero); the extensions validate this.Eastern Standard Time, W. Europe Standard Time). Ensure these exist on the host OS.GeneratePackageOnBuild is enabled; dotnet pack will produce the NuGet package with this README bundled.