Should I file a bug? πŸ˜€

https://programming.dev/post/10803496

Should I file a bug? πŸ˜€ - programming.dev

TIL: Sweden had February 30 in 1712 https://en.wikipedia.org/wiki/1712_in_Sweden [https://en.wikipedia.org/wiki/1712_in_Sweden] , so I decided to see how chrono handled that. Result (as expected): Not well! πŸ˜„ I also tested Java with java ZonedDateTime feb30 = ZonedDateTime.of(1712,2,30, 0,0,0,0, ZoneId.of("Europe/Stockholm")); with simmilar result java.time.DateTimeException: Invalid date 'FEBRUARY 30' So, lets take a minute of silence for all the programmers of history related software, may the spagetti monster have mercy on their souls.

Yes, Sweden really screwed up the first attempt at switching to Gregorian calendar. But there were also multiple countries who switched back and forth a couple of times. Or Switzerland where each administrative region switched separately.

But I think we in still Sweden β€œwin” for worst screw up. Also, there is no good way to handle these dates without specific reference to precise location and which calender they refer to (timestamps will be ambiguous when switching back to Julian calendar).

Next time trying to handle a date…