System.Xml.Schema.XsdDateTime.ToZulu C# (CSharp) Méthode

ToZulu() public méthode

public ToZulu ( ) : System.DateTime
Résultat System.DateTime
        public DateTime ToZulu() {
            switch (InternalKind) {
                case XsdDateTimeKind.Zulu:
                    // set it to UTC
                    return new DateTime(dt.Ticks, DateTimeKind.Utc);
                case XsdDateTimeKind.LocalEastOfZulu:
                    // Adjust to UTC and then convert to local in the current time zone
                    return new DateTime(dt.Subtract(new TimeSpan(ZoneHour, ZoneMinute, 0)).Ticks, DateTimeKind.Utc);
                case XsdDateTimeKind.LocalWestOfZulu:
                    // Adjust to UTC and then convert to local in the current time zone
                    return new DateTime(dt.Add(new TimeSpan(ZoneHour, ZoneMinute, 0)).Ticks, DateTimeKind.Utc); 
                default:
                    return dt;
            }
        }