Here you can find the source of timestamp2Calendar(long timestamp)
public static Calendar timestamp2Calendar(long timestamp)
//package com.java2s; /**/* w w w. j a va 2s.c om*/ * Utils class for the stats * S23Y (2015). Licensed under the Apache License, Version 2.0. * Author: Thibaud Ledent */ import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class Main { public static Calendar timestamp2Calendar(long timestamp) { Date date = timestamp2Date(timestamp); Calendar cal = Calendar.getInstance(); cal.setTimeZone(TimeZone.getTimeZone("Europe/Brussels")); cal.setTime(date); return cal; } /** * Converts a unix timestamp in seconds to a Date. * @param timestamp a timestamp to convert * @return a Date corresponding to the timestamp in unix epoch timestamp (seconds) */ public static Date timestamp2Date(long timestamp) { return new Date(timestamp * 1000); } }