PURPOSE OPERATION COMMAND LINES OPTIONS RELATED PROGRAMS
Author: Dan Mares, dmares @ maresware . com
Portions Copyright © 1998-2021 by Dan Mares and Mares and Company, LLC
Phone: 678-427-3275
Last update: December 29, 2009.
All programs are command line programs.
MUST be run within a command window as administrator.
This is a simple program designed to place the date, time and calendar on the screen.
It can the date and time in single string output format to be used
as environment variables which will then be used in scripts
or as command line arguments to programs using date/time items.
It can also create the date and time in single string format to be
sent to programs for use in determining current date.
The output of this program is especially useful in scripts to
generate date segments to use as environmant variables in programs and
scripts.
It can also interpret and printout julian dates.
With options, you can print this months calendar with a heading.
However, the program is designed to produce a more elaborate output of combinations of todays, month, day, year, and various time and julian date information.
The power of the program comes from its ability to produce an output that can be redirected to a file which will them be used to generate various information in the form of environment variables relating to the month, day, year, etc, information. These environment variables can be used to set file or folder names, and other information which may be useful in unnatended scripts.
The options allow the output of the following:
These items which are output to the screen can be used in scripts to generate environment variables which will later be used create filenames and folder names relating to a particula date and time. This is useful when using in an upcopy script to creats pseudo backup files.
c:>dater
/* gets help screen with options identified */
c:>dater -c
/* prints the current month's calendar. If the current month is January, print january */
c:>dater -C mm yyyy
/* prints the months calendar of this particular year */
c:>dater mm yyyy
/* prints the months calendar of this particular year */
c:>dater -C yyyy
/* prints this years calendar */
c:>dater yyyy
/* prints this years calendar */
c:>dater mm dd yyyy
/* prints the mm dd yyyy in a Julian format: 10/01/1990=1990274 */
c:>dater -n
/* prints date/time as numeric "20080921145346", which is Sept. 21, 2008, 14:53:46 */
C:>dater -A
/* prints the current month in 3 character alpha:
ie: JAN, FEB, etc*/
C:>dater -a
/* prints the current month as a string
ie: January, February, etc*/
C:>dater -m
/* prints the current month as a 2 digit number: 02*/
C:>dater -d
/* prints the current day as a 2 digit number: 28*/
C:>dater -y
/* prints the current year as a 4 digit number: 2008*/
C:>dater -H
/* prints the current hour as a 2 digit number: 14*/
C:>dater -M
/* prints the current minute as a 2 digit number: 02*/
C:>dater -S
/* prints the seconds as a 2 digit number. 50 */
C:>dater -j
/* prints todays julian as a 3 digit number. 360 */
C:>dater -J
/* prints todays julian as a 7 digit number. 2008360 */
C:>dater --anyliteral,
Using a minusminus (--) option, follow it directly with any literal you want added.
If you wish to add spaces, embed the entire literal within " quotes "
(sample: C:>dater --"SET DATEMO=" -m).
and redirected:
C:>dater --"SET DATEMO=" -m >> filename.bat).
c:>dater 10 1 1990
/*prints the julian day of the 3 items. October 1, 1990 */
as: 10/01/1990=1990274
The three items must be seperate and can be the ONLY items on the command line.
Sample header line of -c output:
Sunday, September 21, 2008 15:01:58 EST. DST(+5) 2008265 1222023718 where the 1222023718 is the system time in traditional Microsoft format
Sample output of dater -n:
20080921150320
-n print the date and time in as a numeric format (YYYYMMDDHHMMSS), 20080922085918.
-c print this months calendar. With a heading line of format
Saturday, September 20, 2008 14:53:39 EST. DST(+5) 2008264 1221936819
-C mm yyyy print the mm of yyyy
-C yyyy print the entire yyyy
-j julian day of year, in ddd format, i.e. 265
-J julian date in YYYYddd format, 2008265
-a print full name of month (January, February, etc.)
-A print 3 character, abbreviated month name. (JAN, FEB, MAR etc)
-m print individual month in mm format
-d print individual day in dd format
-y print year in yyyy format
-t print (t)time in HH:MM:HH
-H (hours) print Hour in HH format
-M (min) print Minutes in MM format
-S (secs) print seconds in SS format
-T print time is long seconds. (19023456789) Easy to subtract two times
--[literal] use the minusminus to insert a literal. If spaces are to be inserted, quote the item. If fact, you can't go wrong always quoting.
Options can be combined to form contiguous string output
-mdyHMS gets something like: 02032008230101
Special delimeters are recognized (colon :, dash -, slash /) are recognized
as seperators for the mdy, HMS items, and can be directly embedded.
ie. -m:d:y --"spaces" -H-M-S will yield: 02:03:2008 23:10:59
if only format of: mm dd yyyy on command line by itself, then that date is
converted to julian date, and displayed
C:>dater 2 2 2008 results in: 02/02/2008=2008033
CAL
top