DateUtils { public static long getPreMinuteMills(long rightnow) { return rightnow - (rightnow % MILLISECONDS_PER_MINUTE) - 1; }  static int getDelayToNextMinute(long rightnow); static long getPreMinuteMills(long rightnow); static String dateToStr(Date date); static String dateToStr(Date date, String format); static Date strToDate(String dateStr); static Long strToLong(String dateStr); static Date strToDate(String dateStr, String format); static String dateToMillisStr(Date date); static Date millisStrToDate(String millisDateStr); static final int MILLISECONDS_PER_SECONDE; static final int MILLISECONDS_PER_MINUTE; static final int MILLISECONDS_PER_HOUR; static final long MILLISECONDS_PER_DAY; static final String DATE_FORMAT_TIME; static final String DATE_FORMAT_MILLS_TIME; }
@Test public void getPreMinuteMills() throws Exception { long now = System.currentTimeMillis(); long pre = DateUtils.getPreMinuteMills(now); Assert.assertTrue(now - pre < 60000); }