Today, our Brazilian users generate a lot of crash reports for us. I tracked it down to this code that throws a Joda exception:
import org.joda.time.DateTime; import org.joda.time.DateTimeUtils; import org.joda.time.DateTimeZone; import org.joda.time.LocalTime; public class ScratchSpace { public static void main(String[] args) {
An exception:
Exception in thread "main" org.joda.time.IllegalFieldValueException: Value 0 for hourOfDay is not supported: Illegal instant due to time zone offset transition (daylight savings time 'gap'): 2015-10-18T00:29:18.078 (America/Sao_Paulo) at org.joda.time.chrono.ZonedChronology$ZonedDateTimeField.set(ZonedChronology.java:486) at org.joda.time.chrono.BaseChronology.set(BaseChronology.java:240) at org.joda.time.LocalTime.toDateTimeToday(LocalTime.java:1287) at org.joda.time.LocalTime.toDateTimeToday(LocalTime.java:1270)
I am using Java 1.8.0_60 on OS X 10.11 with Joda Time 2.8.2.
What work will allow me to correctly get a DateTime instance representing the time in the current day that will be shifted in milliseconds after the start of the day?
source share