public virtual DateTime ToLocalTime(DateTime time) {
if (time.Kind == DateTimeKind.Local) {
return time;
}
Boolean isAmbiguousLocalDst = false;
Int64 offset = ((CurrentSystemTimeZone)(TimeZone.CurrentTimeZone)).GetUtcOffsetFromUniversalTime(time, ref isAmbiguousLocalDst);
return new DateTime(time.Ticks + offset, DateTimeKind.Local, isAmbiguousLocalDst);
}