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: Pierre.Bru@spotimage.fr Subject: Re: Y2K Conversion of Date to Internal Format Date: 1998/08/24 Message-ID: <6rs3tp$2t7$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 384218513 References: <35D8AD45.458E8C95@idirect.com> <01bdcac2$35061860$7df84018@fsys.wave.shaw.ca> <01bdcb38$5fecbf40$2e0f4018@fsys.wave.shaw.ca> <35DB845F.918A044@idirect.com> <199808201251.HAA30561@x8.dejanews.com> <35DD8F5C.ED2765B7@idirect.com> Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Mon Aug 24 16:21:12 1998 GMT Newsgroups: vmsnet.pdp-11,alt.sys.pdp11,comp.os.vms,comp.sys.dec X-Http-User-Agent: Mozilla/3.03Gold (X11; I; OpenVMS V7.0 DEC 3000 - M300X) via proxy gateway CERN-HTTPD/3.0 libwww/2.17 In article <35DD8F5C.ED2765B7@idirect.com>, Jerome Fine wrote: > >Pierre.Bru@spotimage.fr wrote: > Jerome Fine replies: > > Thank you very much. Do you have a reference for this algorithm? > Very often, the source of some information leads to some more that > is also useful. this is 'ALGORITHM 199' of 'Association for Computiong Machinery' (ACM) http://www.math.utah.edu/ftp/pub/tex/bib/toc/cacm1960.html ftp://ftp.math.utah.edu/pub/tex/bib/cacm1960.html#Tantzen:1963:AAC [...] > > I can give you explanations for all these 'magic' numbers if you want. > > Thank you. Rob Brown was able to do so already. If you have a different > interpretation, please add to the explanation. I mean the magic-numbers in the posted DCL algorithm, not in yours. [...] > The above algorithms seem just fine. But, unfortunately, although they > are obviously great for the problem they solve, I cannot use either for > the following 2 reasons: > (a) The base year is not 26-Dec-1909 and the application programs > must keep compatible with the existing data base, and I know. this is a general algorithm to compute the julian day number from any gregorain date. if you want the base date be 26-Dec-1909, compute the julian day number for 26-Dec-1909, and substract this value from the result. > (b) They have too much code to fit in the same space as the original > algorithm which broke on 05-Feb-2000. too much code ? the computation 'd/m/y'->'julian' is just : $ if m.gt.2 $ then $ m = m - 3 $ else $ m = m + 9 $ y = y - 1 $ endif $ $ c = y / 100 $ y = y - 100*c $ $ j = c*146097/4 + y*1461/4 + (m*153 + 2)/5 + d + 1721119 the "big" part is for 'julian'->'d/m/y' ... it can easilly be re-worked to be table-driven. I'm not trying in any way to advocate this algorithm. I've just posted it because I thouth it could help you to solve your problem. Pierre. -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum