Skip to content

DateTimeZoneExtensions Class ​

Definition ​

DateTime timezone helpers that resolve Windows/IANA timezone names via TimeZones (which downloads/maps CLDR data through JASE.IO). Separated from DateTimeExtensions so the pure, BCL-only date helpers can live in the dependency-light JASE.Primitives package while these Core-coupled helpers remain here. The TimeZoneInfo-based ToTimezone overload stays in Primitives.

  • Namespace: JASE.Extensions
  • Assembly: JASE.dll

Methods ​

NameDescription
TimeZoneInfo GetTimeZoneInfo(string timezone)Returns TimeZoneInfo class for provided timezone name, supports Windows and IANA timezone naming
DateTime ToTimezone(DateTime date, string timezone, string sourceTimezone = null)Converts input DateTime to the destination timezone
DateTime ToTimezone(DateTime? date, string timezone)Overload for nullable DateTime variable