For our Xalan Team: Here is some communications from the Joda-Time group regarding calendar and timekeeping issues.
I will be sharing more information on this topic in hopes of building a robust date-time EXSLT framework for Xalan-C. Joda-Time is Java based and uses Long (64bit) data type to represent a millisecond time continuum with zero at Jan 1, 1970. The Joda-Time continuum is good for +/- 260 million years. Their FAQ has a more accurate upper-lower bound description. The C/C++ libraries for 32-bit platforms have a time_t (32bit) representing seconds since Jan 1, 1970 and will only represent a time continuum that is good for +/- 68 years. Newer 64-bit C/C++ libraries implement time_t as a 64-bit value. Steven J. Hathaway ---------------------------- Original Message ---------------------------- Subject: Re: [Joda-interest] Joda-Time Implementation Issues - Calendars of Antiquity From: "Stephen Colebourne" <scolebou...@joda.org> Date: Tue, April 17, 2012 3:33 am To: "Discussion of the Joda project" <joda-inter...@lists.sourceforge.net> -------------------------------------------------------------------------- On 16 April 2012 04:25, Steve Hathaway <shath...@e-z.net> wrote: > I am also acquainted with the Baha'i Calendar which is based > on the solar year. Year 1 falls in the year 1844 of the > Gregorian calendar. This calendar has 19 months of 19 days. > There are 4-5 intercalary days appended to the end of the > year. The new year (Naw Ruz) is not January 1. Leap years > are currently computed according to the Gregorian Algorithm. Joda-Time is not supplied with the Baha'i calendar, but it should be possible to implement. > My understanding of the Gregorian Calendar differs slightly > from what the Joda-Time has in their documentation. > > Like the Julian Calendar, the Gregorian Calendar has no > year zero. The Year 1/BC immediately precedes the Year 1/AD. > And the Year 1/BC is the end of a 400-year cycle and is > therefore a leap year. Joda-Time has two separate year concepts. The year is the proleptic year used by astronomers. The year-of-era is the one you refer to here: dateTime.get(DateTimeFieldType.yearOfEra()); > The millisecond clock used for timing is also a concern. > Documentation mentions that the clock starts incrementing > millisecond counts at 1970-01-01T00:00Z. My recollection > indicates that the system clock of IBM 370/zSeries mainframes > is a millisecond clock (or microsecond clock) with a rollover vulnerability. > Does Joda-Time have a clock rollover vulnerabiltiy? Joda-Time uses 64 bit long for counting milliseconds. The rollover vulnerability is for systems using a 32 bit number. > I wish to have a calendar system that supports a longevity > of more than 100,000 years, both backwards and forwards on > a solar-based timeline. My preference is to have a timebase > that simulates the vernal (northward) equinox year in preference > to the sidereal year. This tends to promote the Gregorian > Calendar Algorithm of 400 year cycles to represent the > preferred timeline. > There is also a difference in what constitutes a solar year. > One is the measure of time between occurrences of the > vernal (northward) equinox. The other constitutes the > full orbit of the earth as measured by the stars. The > difference between the two computations of solar year is > the effective precession of the earth and the north pole. Joda-Time simply defines a millisecond based system and applies current ISO/Gregorian rules and 86400s day lengths to far future and far past. You could write your own chronology class to calculate differently, but Joda-Time might not be the right choice for that scenario. (ie. Joda-Time is not concerned with details of astronomy/equinox/stars etc - it is primarily concerned with dates and times for commerce. Use for astronomical length dates/times is totally by extrapolation) > It looks to me like Joda-Time is initially implemented to > render ISO years in the positive direction using the > Gregorian Calendar, starting at year 1. > > When reconciling calendars of antiquity on a time continuum, > I would like to see an interactive calendaring system that > can automatically reference specific dates and times > across multiple calendars. Given a Joda-Time date, it can be converted to a date in a different calendar system easily: dateTime.withChronology(CopticChronology.getInstance()) > Most calendars have a day starting in the middle of the night. > Some calendars of antiquity start the day at sunrise. - but these are rare. > Other calendars of antiquity start the day at dusk - but these are rare. Joda-Time has no support for days that do not start at midnight. However, a chronology could be coded that did have such support > Microsoft has also coded for some lunar calendars, but the code is not > open-source. > > Microsoft in their MSDN library has an example of adding > 5 to year, month, day, hour, minute, and second. > I have not yet proven the correctness of their algorithms or their result. I don't know the MSDN classes, but Joda-Time supports addition. Hope this helps Stephen ------------------------------------------------------------------------------ Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free. http://p.sf.net/sfu/Boundary-dev2dev _______________________________________________ Joda-interest mailing list joda-inter...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/joda-interest --------------------------------------------------------------------- To unsubscribe, e-mail: xalan-dev-unsubscr...@xml.apache.org For additional commands, e-mail: xalan-dev-h...@xml.apache.org