Configuring TimeZoneInfo.ConvertTime to Accept an Explicit Source Time Zone for Unspecified DateTime Values
0 reputation · 25 Mar 2026, 09:55 UTC
Goal: Convert a DateTime value whose Kind is Unspecified but which logically represents a specific time zone (e.g., Eastern Standard Time) to UTC while preserving the original zone’s identity for future conversions.
Constraint: TimeZoneInfo.ConvertTime(DateTime, TimeZoneInfo) interprets Unspecified as the system local zone and provides no overload to supply an explicit source time zone, forcing developers to either change the Kind property (which is unsafe) or perform manual offset calculations that lose the original time‑zone ID and cannot handle historic DST rule changes.
Questions: Is there a supported way to supply an explicit source time zone for an Unspecified DateTime without altering its Kind? Can the existing ConvertTime API be extended or wrapped to accept a source TimeZoneInfo while maintaining backward compatibility? What alternatives within .NET allow accurate zone‑aware conversion while retaining the original time‑zone identifier for later use?