您需要传递时间戳(以毫秒为单位):
long test_timestamp = 1499070300000L;LocalDateTime triggerTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(test_timestamp),TimeZone.getDefault().toZoneId());System.out.println(triggerTime);
结果:
2017-07-03T10:25
或
ofEpochSecond改为使用:
long test_timestamp = 1499070300L;LocalDateTime triggerTime = LocalDateTime.ofInstant(Instant.ofEpochSecond(test_timestamp), TimeZone.getDefault().toZoneId());System.out.println(triggerTime);
结果:
2017-07-03T10:25



