@Test public void testSecond() { long now = 1164042317522L; long expected = 1164042318000L; long computed = TimeUtil.computeStartOfNextSecond(now); assertEquals(expected - now, 478); assertEquals(expected, computed); }
public static long computeStartOfNextSecond(long now) { Calendar cal = Calendar.getInstance(); cal.setTime(new Date(now)); cal.set(Calendar.MILLISECOND, 0); cal.add(Calendar.SECOND, 1); return cal.getTime().getTime(); }
TimeUtil { public static long computeStartOfNextSecond(long now) { Calendar cal = Calendar.getInstance(); cal.setTime(new Date(now)); cal.set(Calendar.MILLISECOND, 0); cal.add(Calendar.SECOND, 1); return cal.getTime().getTime(); } }
TimeUtil { public static long computeStartOfNextSecond(long now) { Calendar cal = Calendar.getInstance(); cal.setTime(new Date(now)); cal.set(Calendar.MILLISECOND, 0); cal.add(Calendar.SECOND, 1); return cal.getTime().getTime(); }  }
TimeUtil { public static long computeStartOfNextSecond(long now) { Calendar cal = Calendar.getInstance(); cal.setTime(new Date(now)); cal.set(Calendar.MILLISECOND, 0); cal.add(Calendar.SECOND, 1); return cal.getTime().getTime(); }  static long computeStartOfNextSecond(long now); static long computeStartOfNextMinute(long now); static long computeStartOfNextHour(long now); static long computeStartOfNextDay(long now); static long computeStartOfNextWeek(long now); static long computeStartOfNextMonth(long now); }
TimeUtil { public static long computeStartOfNextSecond(long now) { Calendar cal = Calendar.getInstance(); cal.setTime(new Date(now)); cal.set(Calendar.MILLISECOND, 0); cal.add(Calendar.SECOND, 1); return cal.getTime().getTime(); }  static long computeStartOfNextSecond(long now); static long computeStartOfNextMinute(long now); static long computeStartOfNextHour(long now); static long computeStartOfNextDay(long now); static long computeStartOfNextWeek(long now); static long computeStartOfNextMonth(long now);  }