Here you can find the source of setDate(Calendar cal, long date)
public static void setDate(Calendar cal, long date)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static void setDate(Calendar cal, long date) { int year = (int) (date / 10000); int month = (int) ((date / 100) % 100); int day = (int) (date % 100); cal.set(year, month - 1, day);//from www. j a v a 2 s .co m } }