[comp.os.vms] Dates on the command line

CARTER@MITBATES.BITNET (Tony Carter - MIT Bates Linac) (10/20/87)

>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.