MinSupportedDateTime Property
Collapse the table of content
Expand the table of content

JapaneseCalendar.MinSupportedDateTime Property

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

Gets the earliest date and time supported by the JapaneseCalendar class.

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

'Declaration
Public Overrides ReadOnly Property MinSupportedDateTime As DateTime

Property Value

Type: System.DateTime
The earliest date and time supported by the JapaneseCalendar type, which is equivalent to the first moment of January 1, 1868 C.E. in the Gregorian calendar.

The start of the Meiji era is January 1, 1868 C.E., which in principle is the earliest date supported by the JapaneseCalendar class. However, to maintain compatibility with earlier versions of the .NET Framework, the JapaneseCalendar class permits an additional range of dates from January 1, 1868 through September 7, 1868 C.E.

Microsoft Visual Basic represents time of day as the specified time on the minimum date supported by the DateTime type, which is January 1, 0001 C.E. However, the JapaneseCalendar type does not support that minimum date. Consequently, if your application calls a method to format the time of day using the current calendar but does not specify a format specifier, formatting uses the ISO 8601 sortable ("s") date/time pattern format specifier instead of the default general ("G") date/time pattern format specifier.

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


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 JapaneseCalendar()
      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.JapaneseCalendar
'MinSupportedDateTime: 09/08/0001 (in Gregorian, 09/08/1868)
'MaxSupportedDateTime: 12/31/8011 (in Gregorian, 12/31/9999)



Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft