On Tue, 25 Jan 2022 11:04:42 GMT, Hannes Wallnöfer <hann...@openjdk.org> wrote:
>> I went out of my way to ensure that the _output_ form was not affected, in >> case there is anyone relying on the existing format ... and yes, we have >> tests for that as well. >> >> I'd be open to formally changing the format of the output timestamp, but I >> think that should be a separate RFE. > > What I meant was not to change the format used in javadoc output but rather > to preserve the time zone of the timestamp passed as `--date` option > argument. Since `java.util.Date.toString()` always uses the default time > zone, to reproduce a documentation bundle generated in a different time zone > one would have to set the default time zone in addition to using the `--date` > option. This could be avoided by retaining the `ZonedDateTime` with the > original time zone instead of converting it to a `java.util.Date`. The > following `DateTimeFormatter` instance could then be used to generate a > timestamp string identical to the one produced by `Date.toString()` but with > the correct time zone: > > DateTimeFormatter.ofPattern("EEE MMM dd HH:mm:ss zzz > yyyy").withLocale(Locale.US); Thanks for the suggestio; that helps. ------------- PR: https://git.openjdk.java.net/jdk/pull/7171