Hi Brian,

thanks for your answer, GJChronology gives me some more "correct
centuries" - but just a few.

DateTimeZone zone = DateTimeZone.forID("UTC");
Chronology bc = GJChronology.getInstance();
DateTimeFormatter fmt = ISODateTimeFormat.dateTime();

for (int i = -500; i < 500; i++) {

    DateTime d = new DateTime(i, 1, 1, 0, 0, 0, 0);
    DateTime dt = new DateTime(bc);
    DateTime dt2 = dt.withMillis(d.getMillis());
    System.out.println(fmt.print(dt2));
}

Output:
...
-0201-01-05T00:00:00.000+00:53:28
-0200-01-04T00:00:00.000+00:53:28
...
-0101-01-04T00:00:00.000+00:53:28
-0100-01-03T00:00:00.000+00:53:28
...
-0001-01-03T00:00:00.000+00:53:28
0001-01-03T00:00:00.000+00:53:28
...
0100-01-03T00:00:00.000+00:53:28
0101-01-02T00:00:00.000+00:53:28
...
0200-01-02T00:00:00.000+00:53:28
0201-01-01T00:00:00.000+00:53:28
...
0300-01-01T00:00:00.000+00:53:28
0300-12-31T00:00:00.000+00:53:28
...
0498-12-31T00:00:00.000+00:53:28

Even with GJChronology there are differences ... but think I have to
figure out first whether we need this kind of precision in our
application.

Cheers
Benny

2009/2/5 Brian S O'Neill <bro...@gmail.com>:
> This difference is caused by the julian to gregorian calendar switch.
> DateTime by default uses a proleptic gregorian calendar, but if you use
> GJChronology there should be no difference.
>
> Benny Bräuer wrote:
>> Hi,
>>
>> while creating a DateTime object from the date "0901-01-01T00:00" (=
>> -33733929600000 ms) I found out that joda "recalculates" this to "
>> 0901-01-06T00:53:28.000+00:53:28". The timezone is ok (it is
>> unimportant in the 10th century), but the day changed from 1st January
>> to 6th January.
>> Date itselfs seems to has no problem with this date.
>>
>> Is there an explanation for this behaviour available resp. a solution?
>>
>> Cheers,
>> Benny
>>
>> ------------------------------------------------------------------------------
>> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
>> software. With Adobe AIR, Ajax developers can use existing skills and code to
>> build responsive, highly engaging applications that combine the power of 
>> local
>> resources and data with the reach of the web. Download the Adobe AIR SDK and
>> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
>> _______________________________________________
>> Joda-interest mailing list
>> Joda-interest@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/joda-interest
>>
>>
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code to
> build responsive, highly engaging applications that combine the power of local
> resources and data with the reach of the web. Download the Adobe AIR SDK and
> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
> _______________________________________________
> Joda-interest mailing list
> Joda-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/joda-interest
>

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to