MaxValue Field
Collapse the table of content
Expand the table of content

DateTimeOffset.MaxValue Field

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Represents the greatest possible value of DateTimeOffset. This field is read-only.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Shared ReadOnly MaxValue As DateTimeOffset

The value of this constant is 12/31/9999 11:59:59 PM +00:00.

The MaxValue property is used to determine whether the value of a new DateTimeOffset object or the DateTimeOffset value returned by an arithmetic operation is the same as or earlier than this maximum range value. If it is not, the method throws an ArgumentOutOfRangeException. Any DateTimeOffset value is converted to Coordinated Universal Time (UTC) before the method compares it with MaxValue. This means that a DateTimeOffset value whose date and time are close to the maximum range, but whose offset is negative, may throw an exception. For example, the value 12/31/9999 11:00 PM -02:00 is out of range because it is one hour later than MaxValue when it is converted to UTC.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft