Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!decvax!decwrl!ucbvax!info-vax From: ESMP09@SLACTWGM.BITNET Newsgroups: mod.computers.vax Subject: Re: Julian date Message-ID: <8602270123.AA11292@ucbjade.Berkeley.Edu> Date: Sat, 1-Mar-86 14:27:46 EST Article-I.D.: ucbjade.8602270123.AA11292 Posted: Sat Mar 1 14:27:46 1986 Date-Received: Sun, 2-Mar-86 05:19:36 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 28 Approved: info-vax@sri-kl.arpa >> I have an application that would like to determine the "Julian date" >> in DCL (ie yyddd where ddd is the day of the year). There is no lexical >> function for this (or is there?). Has anyone done this or have any ideas? The following code fragment illustrates a method of satisfying this need. Ed Miller ESMP09@SLACTWGM.BITNET - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $ $ NOW= F$CVTIME (,,"DATE") $ LOW= 0 $ HIG= 366 $ LOOP: $ CUR= (LOW+HIG)/2 $ TMP= F$CVTIME ("01-JAN+''CUR'-",,"DATE") $ IF TMP .EQS. NOW THEN GOTO DONE $ IF TMP .GTS. NOW THEN HIG= CUR-1 $ IF TMP .LTS. NOW THEN LOW= CUR+1 $ GOTO LOOP $ DONE: $ DAY_OF_YEAR= "00" + F$STRING (CUR+1) $ DAY_OF_YEAR= F$EXTRACT (F$LENGTH (DAY_OF_YEAR)-3,3,DAY_OF_YEAR) $ SHOW SYMBOL DAY_OF_YEAR $ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -