Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static void copyTo(Calendar from, Calendar to) { int year = from.get(Calendar.YEAR); int month = from.get(Calendar.MONTH); int day = from.get(Calendar.DAY_OF_MONTH); to.set(year, month, day); to.getTimeInMillis(); } }