我有這個毫秒:1570046362841使用版本 1進(jìn)行轉(zhuǎn)換時:var myDate = ZonedDateTime.ofInstant(Instant.ofEpochSecond(1570046362841), ZoneId.of("America/New_York"));我會得到這個結(jié)果(這是錯誤的?。?51722-10-16T03:58:54-04:00[America/New_York]但是,當(dāng)使用版本 2進(jìn)行轉(zhuǎn)換時: final String dateFormat = "yyyy-MM-dd HH:mm:ss SSS"; SimpleDateFormat formatter = new SimpleDateFormat(dateFormat); formatter.setTimeZone(TimeZone.getTimeZone("America/New_York")); var dateObj = new Date(1570046362841); var myDate = formatter.format(dateObj);我得到正確的結(jié)果:2019-10-02 15:59:59 934為什么版本1是錯誤的?版本 1 有什么問題?
添加回答
舉報
0/150
提交
取消