ThaiBuddhistCalendar.MaxSupportedDateTime Property

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

Gets the latest date and time supported by the ThaiBuddhistCalendar class.

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

Syntax

Public Overrides ReadOnly Property MaxSupportedDateTime As DateTime
public override DateTime MaxSupportedDateTime { get; }

Property Value

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

Examples

The following example gets the minimum value and the maximum value of the ThaiBuddhistCalendar class.

Imports System.Globalization

Public Class Example

   Public Shared Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock)

      ' Create an instance of the calendar.
      Dim myCal As New ThaiBuddhistCalendar()
      outputBlock.Text &= myCal.ToString() & vbCrLf

      ' 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
      outputBlock.Text += String.Format("MinSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMin), myCal.GetDayOfMonth(myMin), myCal.GetYear(myMin))
      outputBlock.Text += String.Format(" (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre.GetMonth(myMin), myGre.GetDayOfMonth(myMin), myGre.GetYear(myMin)) & vbCrLf

      ' Display the MaxSupportedDateTime and its equivalent in the GregorianCalendar.
      Dim myMax As DateTime = myCal.MaxSupportedDateTime
      outputBlock.Text += String.Format("MaxSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMax), myCal.GetDayOfMonth(myMax), myCal.GetYear(myMax))
      outputBlock.Text += String.Format(" (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre.GetMonth(myMax), myGre.GetDayOfMonth(myMax), myGre.GetYear(myMax)) & vbCrLf

   End Sub 'Main 

End Class 'SamplesCalendar


'This code produces the following output.
'
'System.Globalization.ThaiBuddhistCalendar
'MinSupportedDateTime: 01/01/0544 (in Gregorian, 01/01/0001)
'MaxSupportedDateTime: 12/31/10542 (in Gregorian, 12/31/9999)

using System;
using System.Globalization;


public class Example
{

   public static void Demo(System.Windows.Controls.TextBlock outputBlock)
   {

      // Create an instance of the calendar.
      ThaiBuddhistCalendar myCal = new ThaiBuddhistCalendar();
      outputBlock.Text += myCal.ToString() + "\n";

      // Create an instance of the GregorianCalendar.
      GregorianCalendar myGre = new GregorianCalendar();

      // Display the MinSupportedDateTime and its equivalent in the GregorianCalendar.
      DateTime myMin = myCal.MinSupportedDateTime;
      outputBlock.Text += String.Format("MinSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMin), myCal.GetDayOfMonth(myMin), myCal.GetYear(myMin));
      outputBlock.Text += String.Format(" (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre.GetMonth(myMin), myGre.GetDayOfMonth(myMin), myGre.GetYear(myMin)) + "\n";

      // Display the MaxSupportedDateTime and its equivalent in the GregorianCalendar.
      DateTime myMax = myCal.MaxSupportedDateTime;
      outputBlock.Text += String.Format("MaxSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMax), myCal.GetDayOfMonth(myMax), myCal.GetYear(myMax));
      outputBlock.Text += String.Format(" (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre.GetMonth(myMax), myGre.GetDayOfMonth(myMax), myGre.GetYear(myMax)) + "\n";

   }

}


/*
This code produces the following output.

System.Globalization.ThaiBuddhistCalendar
MinSupportedDateTime: 01/01/0544 (in Gregorian, 01/01/0001)
MaxSupportedDateTime: 12/31/10542 (in Gregorian, 12/31/9999)

*/

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Platforms

Windows Phone

See Also

Reference

ThaiBuddhistCalendar Class

System.Globalization Namespace