code: public static GregorianCalendar millisToCalendar(long millis) {
  
          GregorianCalendar result = new GregorianCalendar();
          result.setTimeZone(TimeZone.getTimeZone("GMT"));
          result.setTimeInMillis((long)(Math.ceil(millis / 1000) * 1000));
          return result;
      }
docs: Converts milliseconds into a calendar object.
  
  @param millis a time given in milliseconds after epoch
  @return the calendar object for the given time