public static void main(String[] args) { // System.out.println(DateTimeUtils.canConvertToDate("003-01-01")); U.p(DateTimeUtils.convertUTCtoLocalTime("2009-12-31 16:00:00.0Z")); // long epoch = new java.text.SimpleDateFormat ("MM/dd/yyyy HH:mm:ss").parse("01/01/1970 // 01:00:00").getTime(); }
/** * @see convertUTCtoLocalTime(String cityName, String utcDateTimeString) * @param utcDateTime Utc格式的时间 * @return */ public static Date convertUTCtoLocalTime(Date utcDateTime) { String utcDateTimeString = DateTimeUtils.getDateString(utcDateTime, "yyyy-MM-dd HH:mm:ss z'('Z')'"); return convertUTCtoLocalTime("SH", utcDateTimeString); }