Re: Compute Date Duration
Simon Coulter <shc-Q/[email protected]>
| Newsgroups | gmane.comp.lang.as400.mi |
|---|---|
| Message-ID | <[email protected]> |
On 17/10/2005, at 7:46 PM, Beppe Costa wrote:
> The MI reference says 1721426 but the C/MI example use 1721424
Scaliger number 1721426 equates to 0001-01-01
Scaliger number 1721424 equates to 0000-12-30 (which is a nonsense date
because there was no year 0--hence all the confusion with the morons
who think a new century starts when the zeroes tick over). 1721424
should be a BC date but CDD converts it to 0000-12-31 when using an SAA
Calendar.
Given that all dates prior to 14th October 1582 don't allow for the
"missing" dates they're all wrong anyhow and that's ignoring the
confusion created by different countries adopting the Gregorian
calendar at different times.
> #define GREGORIAN_TIMELINE_START 1721424
>
> However it seems that both values work the same.
They both work because they are in the same time line--one is just two
days earlier than the other. The earliest Scaliger number allowed in an
SAA calendar is 1721060 which equates to 0000-01-01 (nonsense date, see
above). Anything earlier than that results in MCH1867 with reason code
24 "No valid calendar effective date". The correct starting effective
date is 1721426. The same exception occurs when specifying an ending
effective date greater than 5373485.
Scaliger numbers go back to sometime in 4000BC (I think) so perhaps
defining the correct calendar might cause the MI instructions to handle
earlier dates but I suspect that might not be the case. What business
reason is there for dealing with such early dates? Scaliger numbers
also go beyond year 9999 but the 4-digit year restrictions probably
scupper any attempt to use them.
Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software AS/400 Technical Specialists
http://www.flybynight.com.au/
Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\
Fax: +61 3 9419 0175 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------
_______________________________________________
This is the MI Programming on the AS400 / iSeries (MI400) mailing list
To post a message email: MI400-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/mi400
or email: MI400-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mi400.