new File(url).lastModified()
returns a long
equal to the number of milliseconds since the epoch, which is GMT-based.
What is a simple way to convert this to a String
representing system-local date/time?
If you really need to see an attempt from me here it is but it's a terrible mess and it's wrong anyway:
LocalDateTime.ofEpochSecond(new File(url).lastModified()/1000,0,ZoneOffset.UTC).atZone(ZoneId.of("UTC")).format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.LONG))
Beyond LocalDateTime
I just have no idea how the time API works.
FileTime
differently to that default, without first going back to square one usingFileTime::toMillis
? – Whoop