diff options
Diffstat (limited to 'src/mscorlib/shared/System/Globalization/DaylightTime.cs')
-rw-r--r-- | src/mscorlib/shared/System/Globalization/DaylightTime.cs | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/mscorlib/shared/System/Globalization/DaylightTime.cs b/src/mscorlib/shared/System/Globalization/DaylightTime.cs new file mode 100644 index 0000000000..b3c70e1d10 --- /dev/null +++ b/src/mscorlib/shared/System/Globalization/DaylightTime.cs @@ -0,0 +1,50 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Globalization +{ + // This class represents a starting/ending time for a period of daylight saving time. + [Serializable] + public class DaylightTime + { + private readonly DateTime _start; + private readonly DateTime _end; + private readonly TimeSpan _delta; + + private DaylightTime() + { + } + + public DaylightTime(DateTime start, DateTime end, TimeSpan delta) + { + _start = start; + _end = end; + _delta = delta; + } + + // The start date of a daylight saving period. + public DateTime Start => _start; + + // The end date of a daylight saving period. + public DateTime End => _end; + + // Delta to stardard offset in ticks. + public TimeSpan Delta => _delta; + } + + // Value type version of DaylightTime + internal struct DaylightTimeStruct + { + public DaylightTimeStruct(DateTime start, DateTime end, TimeSpan delta) + { + Start = start; + End = end; + Delta = delta; + } + + public readonly DateTime Start; + public readonly DateTime End; + public readonly TimeSpan Delta; + } +} |