Possible casing issue with DateTimeFormatter in JDK 15 on

Naoto Sato naoto.sato at oracle.com
Mon Apr 18 17:04:20 UTC 2022


Hi Mark,

Please use core-libs-dev mailing list for the specific discussion.

As to your question, short display names of the time zone depend on the 
location, so you will need to be specific. If you need "EDT" for eg 
"America/New_York" time zone, you will have to specify Locale.US, 
otherwise it may end up "GMT-04:00", eg in Locale.UK.

Naoto

On 4/17/22 1:13 AM, Mark Derricutt wrote:
>   Looks like this is the case.  Setting the Locale specifically resolved my
> casing issue. Interestingly tho, where my original test had returned
> EST/ESD - under 11+ I ended up with EST/GMT-04:00 in an old day light
> savings related test:
> 
> expected: "Feb 28, 7:00PM (EST) - Aug 7, 8:00PM 2014 (EDT)"
>   but was: "Feb 28, 7:00PM (EST) - Aug 7, 8:00PM 2014 (GMT-04:00)"
> 
> 
> [1] says there’s no such Timezone as EDT - yet it seems like it existed in
> JDK8 - I assume that was removed at some point?
> 
> 
> [1]
> https://stackoverflow.com/questions/11129108/converting-edt-time-zone-to-gmt-not-working-fine-in-java
> 


More information about the discuss mailing list