开发者

Factory settings Jodatime - Where to find the specific historic cutover dates/times?

I use the Joda time package to calculate durations between two historic instances in times in an Android application/activity. The two instances may for example have happened in the 19th century in Russia (Julian calendar system – before Russia adopted the Gregorian calendar system) and 20th Century western Europe (Gregorian calendar).

The inconvenience is that I now have to choose Julian or Gregorian chronologies based on my knowledge on specific countries actual cutover dates. These individual cutover dates ca开发者_如何学运维n be found at Wikipedia or in the litterature.

As I see it, there are three solutions to my problems:

1) Look up all the cutover dates for the countries in literature. Then manually punch in the specific cutover date/time for the individual time zones. And use the factory setting in GJChronology.getInstance(zone, factorySettingCutoverDateTimeMillis, 4) where factorySettingCutoverDateTimeMillis is a long containing the milliseconds value of the specific instance in time when the cutover between Julian and Gregorian calendars happened in the specific DateTimeZone zone.

2) Identify where the specific cutover dates eventually are located in Jodatime (or elsewhere accessible in Android), and then make use of them.

3) Use the dafault GJChronology.getInstance(zone, null, 4) that specifies the default date in October 1582 (that is correct for many countries, but not all).

Solution 1) is possible, but require some manual labour to implement. Solution 2 is best, while solution 3) is where I am now using the default in the GJChronology or picking Julian or Gregorian if I know the particular calendar system used at that time.

I hope for help to arrive at solution 2) or get help to direct me to the best compiled cutover date/time list online to save work implementing solution 1). Thanks for your help.


I don't believe that Joda Time has that information within it - I certainly haven't come across it. The idea of a "country" doesn't really exist in Joda Time, and the cutover is not necessarily associated with a time zone either. That rules out solution 2, I believe.

I don't know of any official source of this information - I don't believe it's in the Unicode CLDR, for example... but could this page be useful to you? I have no idea of its reliabilty of completeness, but I guess it's a start :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜