Esempio n. 1
0
        public IDateTime ToTimeZone(TimeZoneObservance tzo)
        {
            ITimeZoneInfo tzi = tzo.TimeZoneInfo;

            if (tzi != null)
            {
                return(new iCalDateTime(tzi.OffsetTo.ToLocal(UTC), tzo));
            }
            return(null);
        }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
 public iCalDateTime(DateTime value, TimeZoneObservance tzo)
 {
     Initialize(value, tzo);
 }