$! Convertion date from DCL format to julien format $! Author: Antonio Vigliotti antoniov@shs-av.it $! $! Julien date is the number of days since 1-1-0 $! Converted from a C routine $! Original routine calculate change of calendar by pope Gregor XIII in $! year 1582. Therefor this DCL routine works only since 1582 (in Italy) $! or since 1824 (in Greek). For other countries read history! $! Julien date can be use to compare two dates. $mloop: $ inquire begdat "Beg.Date [dd-mmm-yyyy]" $ if begdat.eqs."" then exit $ inquire enddat "End Date [dd-mmm-yyyy]" $ if enddat.eqs."" then exit $ if enddat.lts.begdat then goto mloop $ dt=begdat $ gosub c2julien $ begj=j $ dt=enddat $ gosub c2julien $ endj=j $ write sys$output enddat," - ",begdat," = ",endj-begj $ goto mloop $c2julien: $ y=f$cvtime(dt,,"year") $ m=f$cvtime(dt,,"month") $ d=f$cvtime(dt,,"day") $ j=y*365+(y+3)/4 $c2loop: $ m=m-1 $ if m.eq.0 then goto c2xit $ j=j+f$int(f$elem(m," ","0 31 28 31 30 31 30 31 31 30 31 30 31")) $ goto c2loop $c2xit: $ j=j+d $ return