Programming Tips - Java: best way to make a copy of a GregorianCalendar

Date: 2021oct10 Language: Java Q. Java: best way to make a copy of a GregorianCalendar A. Use the clone() method
GregorianCalendar newCalendar = (GregorianCalendar) existingCalendar.clone();
By the way, the best way to create a GregorianCalendar is with getInstance()
GregorianCalendar cal = (GregorianCalendar) GregorianCalendar.getInstance();