Java tutorial
import java.util.*; public class Main { public static void main(String[] args) { GregorianCalendar cal1 = (GregorianCalendar) GregorianCalendar.getInstance(); // create a second calendar GregorianCalendar cal2 = new GregorianCalendar(); // clone cal1 to cal2 cal2 = (GregorianCalendar) cal1.clone(); // print cal2 System.out.println(cal2.getTime()); } }