Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bloom-beacon!oberon!cit-vax!ucla-cs!zen!ucbvax!MITBATES.BITNET!CARTER From: CARTER@MITBATES.BITNET (Tony Carter - MIT Bates Linac) Newsgroups: comp.os.vms Subject: Dates on the command line Message-ID: <8710210903.AA28888@ucbvax.Berkeley.EDU> Date: Tue, 20-Oct-87 11:37:00 EDT Article-I.D.: ucbvax.8710210903.AA28888 Posted: Tue Oct 20 11:37:00 1987 Date-Received: Fri, 23-Oct-87 04:32:21 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 19 >I'm writing a fortran program that, among other things, accepts a date >as part of the command line. (ie: STUFF/DATE=12-dec-1987:12:00:00.00) >Getting the date and doing stuff with it is not a problem, however, it >would be nice if the /DATE qualifier would understand "TODAY+12" or "YESTERDAY" >"TOMORROW+12-", etc... What performs these conversions for DCL commands ? >(I understand everything must eventually end up as a quadword for $BINTIM >and $ASCTIM...) Are there routines (maybe that someone has written) to do >this ? You do not say how you are getting the date from the command line. If you are using LIB$GET_FOREIGN then you're on your own. But if you are using the CLI routines (ie CLI$GET_VALUE, CLI$PRESENT, etc...) and declare the qualifier as having type $DATETIME then DCL will interpret the date for you. For instance, using your example of "TODAY+12", DCL will decide what "today" is, add 12, and then when you perform a CLI$GET_VALUE on that qualifier it will return a string in the form of dd-mmm-yyyy. (Note that the double quotes around the date are necessary when there is a +/- sign present) See manual 7B "Command Definition" and 8A "Utility Routines" for more info.