Java tutorial
//package com.java2s; import java.util.Calendar; import java.util.Locale; import java.util.TimeZone; public class Main { public static final TimeZone TIME_ZONE = TimeZone.getDefault(); public static final Locale LOCALE = Locale.getDefault(); public static Calendar fromMillis(long millis) { Calendar calendar = now(); calendar.setTimeInMillis(millis); return calendar; } public static Calendar now() { return Calendar.getInstance(TIME_ZONE, LOCALE); } }