Export (0) Print
Expand All

HijriCalendar.MinSupportedDateTime Property

Gets the earliest date and time supported by this calendar.

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

[ComVisibleAttribute(false)] 
public override DateTime MinSupportedDateTime { get; }
/** @property */
public DateTime get_MinSupportedDateTime ()

public override function get MinSupportedDateTime () : DateTime

Not applicable.

Property Value

The earliest date and time supported by the HijriCalendar type, which is equivalent to the first moment of July 18, 622 C.E. in the Gregorian calendar.

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 HijriCalendar type does not support that minimum date. Consequently, if you call a method to format the time of day using the current calendar but you do 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. For more information, see Standard DateTime Format Strings.

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

using System;
using System.Globalization;


public class SamplesCalendar  {

   public static void Main()  {

      // Create an instance of the calendar.
      HijriCalendar myCal = new HijriCalendar();
      Console.WriteLine( myCal.ToString() );

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

      // Display the MinSupportedDateTime and its equivalent in the GregorianCalendar.
      DateTime myMin = 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.
      DateTime myMax = 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) );

   }

}


/*
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)

*/

import System.*;
import System.Globalization.*;

public class SamplesCalendar
{   
    public static void main(String[] args)
    {
        // Create an instance of the calendar.
        HijriCalendar myCal =  new HijriCalendar();
        Console.WriteLine(myCal.ToString());

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

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

        // Display the MaxSupportedDateTime and its equivalent in the GregorianCalendar.
        DateTime myMax = myCal.get_MaxSupportedDateTime();
        Console.Write("MaxSupportedDateTime: {0}/{1}/{2}",
            ((System.Int32)myCal.GetMonth(myMax)).ToString("D2"),
            ((System.Int32)myCal.GetDayOfMonth(myMax)).ToString("D2"),
            ((System.Int32)myCal.GetYear(myMax)).ToString("D4"));
        Console.WriteLine(" (in Gregorian, {0}/{1}/{2})",
            ((System.Int32)myGre.GetMonth(myMax)).ToString("D2"),
            ((System.Int32)myGre.GetDayOfMonth(myMax)).ToString("D2"),
            ((System.Int32)myGre.GetYear(myMax)).ToString("D4"));
    } //main 
} //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)

*/

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft