-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
8, 11, 17, 18, 19, 20
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
https://docs.oracle.com/en/java/javase/18/docs/api/java.base/java/time/ZoneId.html#SHORT_IDS
says in particular
* ECT - Europe/Paris
The abbreviation "ECT" should most probably be replaced by "CET" (Central European Time).
"CET" is not documented but actually working exactly like "Europe/Paris".
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
"ECT" and "Europe/Paris" are both suitable for java.time.ZoneId.of(String) and
produce the same time-zone.
ACTUAL -
Exception in thread "main" java.time.zone.ZoneRulesException: Unknown time-zone ID: ECT
But ZoneId.of("Europe/Paris") and ZoneId.of("CET") are working as expected.
---------- BEGIN SOURCE ----------
LocalDateTime.parse( "2022-06-30 12:34:56" ).atZone( ZoneId.of("Europe/Paris") ); // ok
LocalDateTime.parse( "2022-06-30 12:34:56" ).atZone( ZoneId.of("ECT") ); // ERROR
LocalDateTime.parse( "2022-06-30 12:34:56" ).atZone( ZoneId.of("CET") ); // ok
(The result should be "2022-06-30 10:34:56").
---------- END SOURCE ----------
https://docs.oracle.com/en/java/javase/18/docs/api/java.base/java/time/ZoneId.html#SHORT_IDS
says in particular
* ECT - Europe/Paris
The abbreviation "ECT" should most probably be replaced by "CET" (Central European Time).
"CET" is not documented but actually working exactly like "Europe/Paris".
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
"ECT" and "Europe/Paris" are both suitable for java.time.ZoneId.of(String) and
produce the same time-zone.
ACTUAL -
Exception in thread "main" java.time.zone.ZoneRulesException: Unknown time-zone ID: ECT
But ZoneId.of("Europe/Paris") and ZoneId.of("CET") are working as expected.
---------- BEGIN SOURCE ----------
LocalDateTime.parse( "2022-06-30 12:34:56" ).atZone( ZoneId.of("Europe/Paris") ); // ok
LocalDateTime.parse( "2022-06-30 12:34:56" ).atZone( ZoneId.of("ECT") ); // ERROR
LocalDateTime.parse( "2022-06-30 12:34:56" ).atZone( ZoneId.of("CET") ); // ok
(The result should be "2022-06-30 10:34:56").
---------- END SOURCE ----------