SETDATE.EXE (c) 1997, Herbert Bushong LICENSE -------- This program is freeware, but it is copyrighted. It may be freely used and distributed as long as it is not altered in any form. The author makes no claims to usability of the program, and the user retains responsibility for any damages use of the program may cause. It works here, it should for you. DESCRIPTION ----------- I had need of a utility like this, so I wrote it. SetDate is a utility to generate a batch file, plain and simple (the OS/2 version -- SetDate2 -- generates a CMD file by default). Running the batch file created will then set various environmental variables regarding the current date. The program executes very quickly, and should add little to no delays. On thing the program does NOT do is alter the environment directly, both for portability reasons and other difficulties in making the changes stick. The program sets several environmental variables. It is up to the user to ensure that there is enough environment space to hold them. The program is leap-year and year 2000 aware. EXECUTION --------- SETDATE [options] [output file] [-? | -h] [CALL] SETDENV.BAT (or the output filename) By default, setdate creates a file SETDENV.BAT (or CMD) in the current directory, containing SET statements for the date in mm/dd/yy format plus individual parts of the date. options -M Sets an additional variable with the name of the Month -D Sets an additional variable with the name of the Day the next three indicate the format(s) of the above 2 switches. if neither are given, these options have no effect. -L Long Name -S Short Name (3 letter abbreviation *DEFAULT*) -B Both -L and -S -W Day of the week (number: 1-7 Mon=1 Sun=7) -Y Day of Year (number: 1-365) -O Fido Day of Year (number: last 2 digits of Day of Year) Useful for Nodelist extensions -A Generate ALL variables (same as -M -D -B -W -Y) -Q Quiet (minimal display output) -F# indicates the format of the full date variable (see below). # equals a value 0 - 9 (0 = default) -(char) any other character after the switch character is considered a Date separator. ex. -- = 10-26-66 -/ = 10/26/66 *DEFAULT* -. = 10.26.66 output file optional path\filename to create. VARIABLE NAMES -------------- The following variables are generated. Those with descriptions marked with a * require a switch to be generated. SDDATE Date format specified by -F SDMONTH Month Number SDDAY Day of Month SDYEAR Full Year value SDMONTHL *Long Name of Month SDMONTHS *Short Name of Month SDDAYL *Long Name of Day of Week SDDAYS *Short Name of Day of week SDDOW *Numeric Day of week (1=Mon 7=Sun) SDDOY *Numeric Day of Year (1 to 365) SDFDOY *Numeric Fido Day of Year (01 to 99) (Last 2 digits of SDDOY, 0 padded) FORMATS (-F#) ------------- The format of the SDDATE variable can be changed with the -F switch using one of the following values (demonstrated with the date 10/26/66 and date separator -- ); 0 = 10-26-66 6 = WEDNESDAY 26-OCTOBER-1966 1 = 10-26-1966 7 = OCT 26, 1966 2 = 26-OCT-1966 8 = OCTOBER 26, 1966 3 = 26-OCTOBER-1966 9 = WEDNESDAY OCTOBER 26, 1966 4 = WED 26-OCT-1966 5 = WED 26-OCTOBER-1966 FINAL NOTE ---------- Don't forget to call the batch file created! The program should be run at the beginning of the day, before anything that requires the variables. Rerun the created batchfile as needed.