GetDaylightDelta method

TimeSpan GetDaylightDelta()
Gets the delta offset for the daylight.

Implementation

TimeSpan GetDaylightDelta() {
  if (SupportsDaylight) {
    // EWS returns a positive offset for time zones that are behind UTC, and
    // a negative one for time zones ahead of UTC. TimeZoneInfo does it the other
    // way around.
    return TimeSpan(
      TransitionToStandard!.TargetPeriod!.Bias!.time -
          TransitionToDaylight!.TargetPeriod!.Bias!.time,
    );
  } else {
    return TimeSpan.ZERO;
  }
}