public IDateTime ToTimeZone(TimeZoneObservance tzo) { ITimeZoneInfo tzi = tzo.TimeZoneInfo; if (tzi != null) { return(new iCalDateTime(tzi.OffsetTo.ToLocal(UTC), tzo)); } return(null); }
private void Initialize(DateTime value, TimeZoneObservance tzo) { if (value.Kind == DateTimeKind.Utc) { this.IsUniversalTime = true; } // Convert all incoming values to UTC. this.Value = DateTime.SpecifyKind(value, DateTimeKind.Utc); this.HasDate = true; this.HasTime = (value.Second != 0 || value.Minute != 0 || value.Hour != 0); if (tzo.TimeZoneInfo != null) { this.TZID = tzo.TimeZoneInfo.TZID; } this.TimeZoneObservance = tzo; this.AssociatedObject = tzo.TimeZoneInfo; }
public iCalDateTime(DateTime value, TimeZoneObservance tzo) { Initialize(value, tzo); }