Ejemplo n.º 1
0
    public static void Main()
    {
        // Sets a DateTime to April 3, 2002 of the Gregorian calendar.
        DateTime myDT = new DateTime(2002, 4, 3, new GregorianCalendar());

        // Creates an instance of the HebrewCalendar.
        HebrewCalendar myCal = new HebrewCalendar();

        // Displays the values of the DateTime.
        Console.WriteLine("April 3, 2002 of the Gregorian calendar equals the following in the Hebrew calendar:");
        DisplayValues(myCal, myDT);

        // Adds two years and ten months.
        myDT = myCal.AddYears(myDT, 2);
        myDT = myCal.AddMonths(myDT, 10);

        // Displays the values of the DateTime.
        Console.WriteLine("After adding two years and ten months:");
        DisplayValues(myCal, myDT);
    }
Ejemplo n.º 2
0
 ///<summary>Adds a number of Hebrew years to this date.</summary>
 ///<param name="hebrewYears">The number of Hebrew years to add.  This parameter can be positive or negative.</param>
 public HebrewDate AddYears(int hebrewYears)
 {
     return(calendar.AddYears(EnglishDate, hebrewYears));
 }