From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,47b877165af3dad0 X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,47b877165af3dad0 X-Google-Attributes: gid1164f8,public X-Google-Thread: fdd80,47b877165af3dad0 X-Google-Attributes: gidfdd80,public X-Google-Thread: ffc31,47b877165af3dad0 X-Google-Attributes: gidffc31,public From: "Rob Brown" Subject: Re: Y2K Conversion of Date to Internal Format Date: 1998/08/19 Message-ID: <01bdcac2$35061860$7df84018@fsys.wave.shaw.ca>#1/1 X-Deja-AN: 382511847 References: <35D8AD45.458E8C95@idirect.com> Organization: Home NNTP-Posting-Date: Tue, 18 Aug 1998 20:11:41 PDT Newsgroups: vmsnet.pdp-11,alt.sys.pdp11,comp.os.vms,comp.sys.dec Jerome Fine wrote in article <35D8AD45.458E8C95@idirect.com>... > DATE = CONVRT ( MONTH, DAY, YEAR ) > MONTH = MONTH - 2 > IF ( MONTH .LE. 0 ) MONTH = MONTH + 12; YEAR = YEAR - 1 > Q = YEAR / 100 > R = YEAR - Q * 100 > DATE = ( YEAR - 1910 ) * 365 + Q / 4 + R / 4 + > ( MONTH + 1 ) * 28 + ( 26 * MONTH - 2 ) / 10 DAY is missing from the DATE formula as shown here, but that is not really relevant to the problem at hand. > The problem is that the algorithm BREAKS on 01-Mar-2000 at which > point the DATE value reverts to the same value as for 06-Feb-2000 > and 24 duplicates are created. March 1 2000 is the first day that 2000 rather than 1999 is used in the DATE formula, and date that Q/4 changes value. (26*MONTH-2) equals 24 on that date, although I can't see what that has to do with anything. The problem obviously has something to do with the 1999 -> 2000 transition, but I can't see what it is right now. I'm sure the formula is fixable but I don't have time to look at it again until tonight. Hope this helps - Rob