The java.util.GregorianCalendar.getGregorianChange() is an inbuilt method in Java which returns the Gregorian Calendar change date which is the change from Julian Calendar dates to Gregorian Calendar dates. It is October 15, 1582 (Gregorian) by default but can be changed using setGregorianDate() function to any other date. All previous dates are present in the Julian Calendar.
public final Date getGregorianChange()
Parameters: The function does not accept any parameters.
Return Values: The function returns the Gregorian Calendar change date for this GregorianCalendar instance.
Input : Tue Jul 24 01:22:29 UTC 2018 Output : Fri Oct 15 00:00:00 UTC 1582 Input: Tue Jul 24 01:22:29 UTC 2018 c.setGregorianChange(new Date()); Output : Tue Jul 24 01:22:29 UTC 2018
Below programs illustrate the java.util.GregorianCalendar.getGregorianChange() function:
Current Date and Time : Fri Jul 27 12:38:41 UTC 2018 Gregorian Date change :Fri Oct 15 00:00:00 UTC 1582
Current Date and Time : Fri Jul 27 12:38:44 UTC 2018 Gregorian Date change :Fri Jul 27 12:38:44 UTC 2018
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.