Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LocalDateTime doesn't support MAX YEAR in certain workflows #433

Open
gowrav27 opened this issue Jun 20, 2017 · 0 comments
Open

LocalDateTime doesn't support MAX YEAR in certain workflows #433

gowrav27 opened this issue Jun 20, 2017 · 0 comments

Comments

@gowrav27
Copy link

gowrav27 commented Jun 20, 2017

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants