@Test public void dateToMillisStr() throws Exception { long d0 = 0l; long d1 = 1501127802975l; long d2 = 1501127835658l; TimeZone timeZone = TimeZone.getDefault(); Date date0 = new Date(d0 - timeZone.getOffset(d0)); Date date1 = new Date(d1 - timeZone.getOffset(d1)); Date date2 = new Date(d2 - timeZone.getOffset(d2)); Assert.assertEquals(DateUtils.dateToMillisStr(date0), "1970-01-01 00:00:00.000"); Assert.assertEquals(DateUtils.dateToMillisStr(date1), "2017-07-27 03:56:42.975"); Assert.assertEquals(DateUtils.dateToMillisStr(date2), "2017-07-27 03:57:15.658"); }
public static String dateToMillisStr(Date date) { return dateToStr(date, DATE_FORMAT_MILLS_TIME); }
DateUtils { public static String dateToMillisStr(Date date) { return dateToStr(date, DATE_FORMAT_MILLS_TIME); } }
DateUtils { public static String dateToMillisStr(Date date) { return dateToStr(date, DATE_FORMAT_MILLS_TIME); }  }
DateUtils { public static String dateToMillisStr(Date date) { return dateToStr(date, DATE_FORMAT_MILLS_TIME); }  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); }
DateUtils { public static String dateToMillisStr(Date date) { return dateToStr(date, DATE_FORMAT_MILLS_TIME); }  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; }