private String getDate(String timeStampStr, String format) { DateFormat formatter = new SimpleDateFormat(format); long timeStamp = Long.parseLong(timeStampStr); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(timeStamp); return formatter.format(calendar.getTime()); }
/** * Get an AppointmentItem using start/end +/- 31 days * * @param account * @param query * @return * @throws HarnessException */ public static AppointmentItem importFromSOAP(ZimbraAccount account, String query) throws HarnessException { Calendar now = Calendar.getInstance(); ZDate date = new ZDate( now.get(Calendar.YEAR), now.get(Calendar.MONTH) + 1, now.get(Calendar.DAY_OF_MONTH), 12, 0, 0); return (importFromSOAP(account, query, date.addDays(-31), date.addDays(31))); }