I develop a custom schedule calendar, with 30 minutes gap, so when i generetae this by adding 30 minutes:
date = date.plusMinutes(minuteStep)
so in moment when our time zone switch to Daylight saving time, jodatime add 1 hour to current time and in this case my schedule got broken, it's posibile to exclude this offset?. Thank's
example:
2021-03-28T00:00:00.000+02:00
2021-03-28T00:30:00.000+02:00
2021-03-28T01:00:00.000+02:00
2021-03-28T01:30:00.000+02:00
and just after this i got:
2021-03-28T03:00:00.000+03:00
It looks like you are using
org.joda.time.DateTimewhich is the wrong class for this requirement. The right class for this requirement would beorg.joda.time.LocalDate.org.joda.time.LocalTimeis useful for representing human-based date-time, such as movie times, or the opening and closing times of the local library, or to create a digital clock etc.LocalDateTime, a combination of LocalDate with LocalTime, can be used to represent a specific event, such as the first race for the Louis Vuitton Cup Finals in America's Cup Challenger Series, which began at 1:10 p.m. on August 17, 2013. Note that this means 1:10 p.m. in local time. (Source)Switching to
org.joda.time.LocalDateshould fix the issue. However, check the following notice at the Home Page of Joda-TimeTherefore, I suggest you switch to the modern date-time API* . You can learn about the modern date-time API from Trail: Date Time.
* For any reason, if you have to stick to Java 6 or Java 7, you can use ThreeTen-Backport which backports most of the java.time functionality to Java 6 & 7. If you are working for an Android project and your Android API level is still not compliant with Java-8, check Java 8+ APIs available through desugaring and How to use ThreeTenABP in Android Project.