GregorianCalendar classgetGregorianChange()method example
Gets the Gregorian Calendar change date.
GregorianCalendarclass getGregorianChange()method example. This example shows you how to use getGregorianChange()method.This method Gets the Gregorian Calendar change date.
Here is the code:-
/**
* @Program that Gets the Gregorian Calendar change date.
* GetGregorianChange.java
* Author:-RoseIndia Team
* Date:-27-May-2008
*/
import java.util.*;
public class GetGregorianChange {
public static void main(String[] args) {
//Creating a Calendar
GregorianCalendar g = new GregorianCalendar(2004, 6, 23);
//Displays the date of the Calendar
System.out.println("Current date of the Calendar is: " + g.get(Calendar.DATE));
//Gets the Gregorian Calendar change date.
Date d = g.getGregorianChange();
//Displays the changed date of the Calendar
System.out.println("Changed date of the Calendar is: " + d.getDate());
}
} |
Output of the program:-
Current date of the Calendar is: 23
Changed date of the Calendar is: 15 |
|