public static Calendar fromUnixTime(long unixTime,TimeUnit timeUnit){
  Calendar calendar=getCalendarInstance();
  calendar.setTimeZone(TimeZone.getDefault());
  long millis=timeUnit.toMillis(unixTime);
  calendar.setTimeInMillis(millis);
  return calendar;
}

public static Calendar fromUnixTime ( long unixTime , TimeUnit timeUnit ) { Calendar calendar = getCalendarInstance ( ) ; calendar . setTimeZone ( TimeZone . getDefault ( ) ) ; long millis = timeUnit . toMillis ( unixTime ) ; calendar . setTimeInMillis ( millis ) ; return calendar ; }
converts unix time in the given time units into java calendar time . unix time is a measure of time from the epoch . therefore is devoid of any timezone information . the current default timezone will be assumed for this function .
