### Question:
DateUtil { public static long getMillSecond(String data){ long time = Long.parseLong(data); if(data.length() == LENGTH_SECOND){ time = Long.parseLong(data) * 1000; } else if(data.length() == LENGTH_MILLISECOND){ time = Long.parseLong(data); } else if(data.length() == LENGTH_MICROSECOND){ time = Long.parseLong(data) / 1000; } else if(data.length() == LENGTH_NANOSECOND){ time = Long.parseLong(data) / 1000000 ; } else if(data.length() < LENGTH_SECOND){ try { long day = Long.parseLong(data); Date date = datetimeFormatter.get().get(DATE_FORMAT).parse(START_TIME); Calendar cal = Calendar.getInstance(); long addMill = date.getTime() + day * 24 * 3600 * 1000; cal.setTimeInMillis(addMill); time = cal.getTimeInMillis(); } catch (Exception ignore){ } } return time; } private  DateUtil(); static java.sql.Date columnToDate(Object column,SimpleDateFormat customTimeFormat); static java.sql.Timestamp columnToTimestamp(Object column,SimpleDateFormat customTimeFormat); static long getMillSecond(String data); static Date stringToDate(String strDate,SimpleDateFormat customTimeFormat); static String dateToString(Date date); static String timestampToString(Date date); static String dateToYearString(Date date); static SimpleDateFormat getDateTimeFormatter(); static SimpleDateFormat getDateFormatter(); static SimpleDateFormat getTimeFormatter(); static SimpleDateFormat getYearFormatter(); static SimpleDateFormat buildDateFormatter(String timeFormat); final static String DATE_REGEX; final static String TIMESTAMP_REGEX; final static String DATETIME_REGEX; final static int LENGTH_SECOND; final static int LENGTH_MILLISECOND; final static int LENGTH_MICROSECOND; final static int LENGTH_NANOSECOND; static ThreadLocal<Map<String,SimpleDateFormat>> datetimeFormatter; }### Answer:
@Test public void testGetMillSecond() { long result = DateUtil.getMillSecond("1584500160000"); Assert.assertEquals(result, 1584500160000L); result = DateUtil.getMillSecond("1584500160000000"); Assert.assertEquals(result, 1584500160000L); result = DateUtil.getMillSecond("1584500160000000000"); Assert.assertEquals(result, 1584500160000L); long expect = 57600000; result = DateUtil.getMillSecond("1"); Assert.assertEquals(result, expect); }