Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

HijriCalendar.MaxSupportedDateTime Property

Gets the latest date and time supported by this calendar.

Namespace:  System.Globalization
Assembly:  mscorlib (in mscorlib.dll)
'Declaration
<ComVisibleAttribute(False)> _
Public Overrides ReadOnly Property MaxSupportedDateTime As DateTime

Property Value

Type: System.DateTime
The latest date and time supported by the HijriCalendar type, which is equivalent to the last moment of December 31, 9999 C.E. in the Gregorian calendar.

December 31, 9999 C.E. is equivalent to the 3rd day of the 4th month of the year 9666 in the Hijri calendar.

The following code example gets the minimum value and the maximum value of the calendar.

Imports System
Imports System.Globalization

Public Class SamplesCalendar   

   Public Shared Sub Main()

      ' Create an instance of the calendar. 
      Dim myCal As New HijriCalendar()
      Console.WriteLine(myCal.ToString())

      ' Create an instance of the GregorianCalendar. 
      Dim myGre As New GregorianCalendar()

      ' Display the MinSupportedDateTime and its equivalent in the GregorianCalendar. 
      Dim myMin As DateTime = myCal.MinSupportedDateTime
      Console.Write("MinSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMin), myCal.GetDayOfMonth(myMin), myCal.GetYear(myMin))
      Console.WriteLine(" (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre.GetMonth(myMin), myGre.GetDayOfMonth(myMin), myGre.GetYear(myMin))

      ' Display the MaxSupportedDateTime and its equivalent in the GregorianCalendar. 
      Dim myMax As DateTime = myCal.MaxSupportedDateTime
      Console.Write("MaxSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMax), myCal.GetDayOfMonth(myMax), myCal.GetYear(myMax))
      Console.WriteLine(" (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre.GetMonth(myMax), myGre.GetDayOfMonth(myMax), myGre.GetYear(myMax))

   End Sub 'Main 

End Class 'SamplesCalendar


'This code produces the following output. 

'System.Globalization.HijriCalendar 
'MinSupportedDateTime: 01/01/0001 (in Gregorian, 07/18/0622) 
'MaxSupportedDateTime: 04/03/9666 (in Gregorian, 12/31/9999)

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.