JodaOrg / joda-time

Joda-Time is the widely used replacement for the Java date and time classes prior to Java SE 8.
http://www.joda.org/joda-time/
Apache License 2.0
4.98k stars 985 forks source link

Discrepancy between 2.13.0 and 2.12.7 #791

Closed wendigo closed 2 months ago

wendigo commented 2 months ago

The Joda-Time project has been running for many years now, and the codebase is stable. Java SE 8 contains a new date and time library that is the successor to Joda-Time. As such Joda-Time is primarily in maintenance mode and there are few things worthy of being raised as an issue.

As a general rule, you should raise a question at Stack Overflow, not here.

Before raising an issue, please check the FAQs. Please also search Stack Overflow and the issue history at GitHub. In particular, if the issue is Android specific, you are unlikely to get any assistance here. Please bear in mind that I work on Joda-Time in my spare time, so there is no guarantee on response time.

In the unlikely event you still think you've found an issue, please delete the text above and describe the problem as follows:

Key information

Problem description

In 2.12.7:

LocalDate localDate = ISODateTimeFormat.date().parseLocalDate("1970-01-01");
        long millis = localDate.toDateTimeAtStartOfDay(DateTimeZone.forID("America/Bahia_Banderas")).getMillis();
25200000

In 2.13.0: 28800000 (1 hr difference)

Test case

wendigo commented 2 months ago
 Historical transitions for Mexico have been updated based on
 official Mexican decrees.  The affected timestamps occur during
 the years 1921-1927, 1931, 1945, 1949-1970, and 1981-1997.
 The affected zones are America/Bahia_Banderas, America/Cancun,
 America/Chihuahua, America/Ciudad_Juarez, America/Hermosillo,
 America/Mazatlan, America/Merida, America/Mexico_City,
 America/Monterrey, America/Ojinaga, and America/Tijuana.
 (Thanks to Heitor David Pinto.)
jodastephen commented 2 months ago

https://github.com/JodaOrg/joda-time/commit/4d2a899867c38292230a61117cb439737052e271#diff-3092a110a205f56fa0c1a34125ff3989632a5a7ceb03c282b262d0f281cda81bL2734