@Test public void testEncoding() { TimeZone timeZone = TimeZone.getTimeZone("America/Los_Angeles"); Calendar cal = make(2016,0,1,0,0,0); cal.setTimeZone(timeZone); String encoded = TimeUtils.encode(cal,false,null).toString(); validateEqual(encoded,"2016-01-01T00:00:00.000"); encoded = TimeUtils.encode(cal,true,null).toString(); validateEqual(encoded,"2016-01-01T00:00:00.000-08:00"); }
public static StringBuilder encode(long timestamp, boolean encodeTzOffset) { Calendar cal = reuseCalendar(timestamp); StringBuilder buf = encode(cal, encodeTzOffset, new StringBuilder()); recycleCalendar(cal); return buf; }
TimeUtils { public static StringBuilder encode(long timestamp, boolean encodeTzOffset) { Calendar cal = reuseCalendar(timestamp); StringBuilder buf = encode(cal, encodeTzOffset, new StringBuilder()); recycleCalendar(cal); return buf; } }
TimeUtils { public static StringBuilder encode(long timestamp, boolean encodeTzOffset) { Calendar cal = reuseCalendar(timestamp); StringBuilder buf = encode(cal, encodeTzOffset, new StringBuilder()); recycleCalendar(cal); return buf; } private  TimeUtils(); }
TimeUtils { public static StringBuilder encode(long timestamp, boolean encodeTzOffset) { Calendar cal = reuseCalendar(timestamp); StringBuilder buf = encode(cal, encodeTzOffset, new StringBuilder()); recycleCalendar(cal); return buf; } private  TimeUtils(); static String getTimePatternTz(); static String getTimePattern(); static String format(long time); static String format(Date time); static Date parseTz(String time); static String fixTime(String time); static Calendar addDays(int count, Calendar timestamp); static Calendar addHours(int count, Calendar timestamp); static Calendar addMinutes(int count, Calendar timestamp); static Calendar addMonths(int count, Calendar timestamp); static Calendar addSeconds(int count, Calendar timestamp); static Calendar addWeeks(int count, Calendar timestamp); static Calendar addYears(int count, Calendar timestamp); static Calendar alignDay(Calendar timestamp); static Calendar alignDays(int interval, Calendar timestamp); static Calendar alignHour(Calendar timestamp); static Calendar alignHours(int interval, Calendar timestamp); static Calendar alignMinute(Calendar timestamp); static Calendar alignMinutes(int interval, Calendar timestamp); static Calendar alignMonth(Calendar timestamp); static Calendar alignSecond(Calendar timestamp); static Calendar alignSeconds(int interval, Calendar timestamp); static Calendar alignWeek(Calendar timestamp); static Calendar alignYear(Calendar timestamp); static long decode(String timestamp); static Calendar decode(String timestamp, Calendar calendar); static StringBuilder encode(long timestamp, boolean encodeTzOffset); static StringBuilder encode(
            Calendar calendar, boolean encodeTzOffset, StringBuilder buf); static void recycleCalendar(Calendar cal); static Calendar reuseCalendar(); static Calendar reuseCalendar(long timestamp); }
TimeUtils { public static StringBuilder encode(long timestamp, boolean encodeTzOffset) { Calendar cal = reuseCalendar(timestamp); StringBuilder buf = encode(cal, encodeTzOffset, new StringBuilder()); recycleCalendar(cal); return buf; } private  TimeUtils(); static String getTimePatternTz(); static String getTimePattern(); static String format(long time); static String format(Date time); static Date parseTz(String time); static String fixTime(String time); static Calendar addDays(int count, Calendar timestamp); static Calendar addHours(int count, Calendar timestamp); static Calendar addMinutes(int count, Calendar timestamp); static Calendar addMonths(int count, Calendar timestamp); static Calendar addSeconds(int count, Calendar timestamp); static Calendar addWeeks(int count, Calendar timestamp); static Calendar addYears(int count, Calendar timestamp); static Calendar alignDay(Calendar timestamp); static Calendar alignDays(int interval, Calendar timestamp); static Calendar alignHour(Calendar timestamp); static Calendar alignHours(int interval, Calendar timestamp); static Calendar alignMinute(Calendar timestamp); static Calendar alignMinutes(int interval, Calendar timestamp); static Calendar alignMonth(Calendar timestamp); static Calendar alignSecond(Calendar timestamp); static Calendar alignSeconds(int interval, Calendar timestamp); static Calendar alignWeek(Calendar timestamp); static Calendar alignYear(Calendar timestamp); static long decode(String timestamp); static Calendar decode(String timestamp, Calendar calendar); static StringBuilder encode(long timestamp, boolean encodeTzOffset); static StringBuilder encode(
            Calendar calendar, boolean encodeTzOffset, StringBuilder buf); static void recycleCalendar(Calendar cal); static Calendar reuseCalendar(); static Calendar reuseCalendar(long timestamp); static final int MILLIS_MINUTE; static final int MILLIS_HOUR; }