-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
Description
LocalDateTime doesn't support MAX YEAR
Joda version:
2.9.9
Ex:
LocalDateTime localDateTimeMax = new LocalDateTime (Long.MAX_VALUE);
new LocalDateTime (localDateTimeMax);
LocalDateTime localDateTime = new LocalDateTime (Long.MAX_VALUE);
System.out.println(localDateTime);
Posted the same on StackOverFlow
Problem description
The toString and certain constructors dont support Long.MAX_VALUE in LocalDateTime
I see this is similar to the issue resolved for DateTime
Example Stack Trace:
Exception in thread "main" org.joda.time.IllegalFieldValueException: Value 292278994 for year must be in the range [-292275054,292278993]
at org.joda.time.field.FieldUtils.verifyValueBounds(FieldUtils.java:234)
at org.joda.time.chrono.BasicYearDateTimeField.set(BasicYearDateTimeField.java:83)
at org.joda.time.chrono.BaseChronology.set(BaseChronology.java:240)
at org.joda.time.format.DateTimeFormatterBuilder$Fraction.printTo(DateTimeFormatterBuilder.java:1806)
at org.joda.time.format.DateTimeFormatterBuilder$Composite.printTo(DateTimeFormatterBuilder.java:2474)
at org.joda.time.format.DateTimeFormatter.printTo(DateTimeFormatter.java:655)
at org.joda.time.format.DateTimeFormatter.print(DateTimeFormatter.java:709)
at org.joda.time.LocalDateTime.toString(LocalDateTime.java:2087)
at java.lang.String.valueOf(String.java:2849)
at java.lang.StringBuilder.append(StringBuilder.java:128)
Reactions are currently unavailable