FULL PRODUCT VERSION :
1.8.0_45
ADDITIONAL OS VERSION INFORMATION :
Windows 7, 64 bit
A DESCRIPTION OF THE PROBLEM :
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMMM yyyy HH:mm:ss:n");
ZoneId zone = ZoneId.of("Europe/Istanbul");
ZonedDateTime start = ZonedDateTime.of(LocalDate.of(1880, Month.JUNE, 12).atStartOfDay(), zone);
start = start.with(TemporalAdjusters.firstDayOfYear()).withHour(0).withMinute(0).withSecond(0).withNano(0);
System.out.println(formatter.format(start));
Above code prints:
01 January 1880 00:02:04:0 instead of 01 January 1880 00:00:00:0
Same code works for other years before ...1879, 1881... etc; as expected.
What is wrong with year 1880.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the code lines about
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
01 January 1880 00:00:00:0
ACTUAL -
01 January 1880 00:02:04:0
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMMM yyyy HH:mm:ss:n");
ZoneId zone = ZoneId.of("Europe/Istanbul");
ZonedDateTime start = ZonedDateTime.of(LocalDate.of(1880, Month.JUNE, 12).atStartOfDay(), zone);
start = start.with(TemporalAdjusters.firstDayOfYear()).withHour(0).withMinute(0).withSecond(0).withNano(0);
System.out.println(formatter.format(start));
---------- END SOURCE ----------
1.8.0_45
ADDITIONAL OS VERSION INFORMATION :
Windows 7, 64 bit
A DESCRIPTION OF THE PROBLEM :
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMMM yyyy HH:mm:ss:n");
ZoneId zone = ZoneId.of("Europe/Istanbul");
ZonedDateTime start = ZonedDateTime.of(LocalDate.of(1880, Month.JUNE, 12).atStartOfDay(), zone);
start = start.with(TemporalAdjusters.firstDayOfYear()).withHour(0).withMinute(0).withSecond(0).withNano(0);
System.out.println(formatter.format(start));
Above code prints:
01 January 1880 00:02:04:0 instead of 01 January 1880 00:00:00:0
Same code works for other years before ...1879, 1881... etc; as expected.
What is wrong with year 1880.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the code lines about
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
01 January 1880 00:00:00:0
ACTUAL -
01 January 1880 00:02:04:0
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMMM yyyy HH:mm:ss:n");
ZoneId zone = ZoneId.of("Europe/Istanbul");
ZonedDateTime start = ZonedDateTime.of(LocalDate.of(1880, Month.JUNE, 12).atStartOfDay(), zone);
start = start.with(TemporalAdjusters.firstDayOfYear()).withHour(0).withMinute(0).withSecond(0).withNano(0);
System.out.println(formatter.format(start));
---------- END SOURCE ----------