This the epoch mili - 1526581800000
The code which am using for conversion is -
LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1526581800000),ZoneId.systemDefault());
System.out.println(localDateTime.format(DateTimeFormatter.ofPattern("dd-MMM-yyyy HH:mm:ss")));
Output which we getting- 17-May-2018 18:30:00
But Expected Output - 18-May-2018 00:00:00
Well, as already mentioned in a comment, your call to
ZoneId.systemDefault()
does not return the expectedZoneId
. That means you either have to adjust the configuration of your system/JVM or specify aZoneId
manually, like this:Output (totally independent from the system's time zone):