Here you can find the source of setTime(Calendar cal, long time)
public static void setTime(Calendar cal, long time)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static void setTime(Calendar cal, long time) { int hour = (int) (time / 10000); int minute = (int) ((time / 100) % 100); int second = (int) (time % 100); cal.set(Calendar.HOUR_OF_DAY, hour); cal.set(Calendar.MINUTE, minute); cal.set(Calendar.SECOND, second); }/*from ww w .j a v a2s . c o m*/ }