IdtTimeZoneToUniversalTime Method
Returns the Universal Coordinated Time (UTC) that corresponds to a
specified local time.
Namespace: InnerDrive.TimeZonesAssembly: InnerDrive.TimeZones (in InnerDrive.TimeZones.dll) Version: 5.2.9017.0
public DateTimeOffset ToUniversalTime(
DateTime time
)
- time DateTime
- A local time.
DateTimeOffsetA
DateTime instance whose value is the UTC that corresponds
to
time.
Some local times do not actually exist, and therefore cannot be
translated to UTC. For example, using U.S. rules, daylight saving time
returns on the second Sunday of March at 2:00 am local time. Wall clock
time advances from 1:59:59 to 3:00:00. Therefore, 2:30 am on that
day never actually happens.
Conversely, some local times happen more than once, as when standard
time returns to the U.S. on the second Sunday of November. On that day,
1:59:59 am daylight saving time goes to 1:00:00 am standard time, so all the local times
between 1:00:00 and 2:00:00 repeat. In this case, the method will choose
either the earlier TimeZoneRule or the later TimeChangeRule,
which may yield unexpected results.