new File(url).lastModified()返回一个等于自纪元以来毫秒数的long整数,这是基于GMT的。 将此转换为表示系统本地日期/时间的String的简单方法是什么? 如果你真的需要在这里看到我的尝试,但这是一个可怕的混乱,无论如何它是错的: LocalDateTime.ofEpochSecond(new File(url).lastModified()/1000,0,ZoneOffset.UTC).atZone(ZoneId.of(“UTC”)).format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.LONG)) 超越LocalDateTime我只是不知道时间API是如何工作的。