Incode Systems Home Page Incode Systems, Inc.


DateCalc



(Windows command line program Win95 or newer)
(03-07-2012 7:29pm DateCalc.exe)

DateCalc - Copyright (C) 2012, Incode Systems, Inc.
Version 0.9.6 www.incodesystems.com mailto:sales1Usage: [Options] MODE [[Date1] [Date2]]

DateCalc performs a variety of date functions and calculations.

Date1 and Date2 are in the format specified in the control panel.
The control panel short date format is now: M/d/yyyy
If not given, they default to the current date.
If Date1 or Date2 is the date is read from the standard input.
If 2 digit year is given, it is assumed to be in the current century.

Options:
-? write this help to the standard output.
--help open DateCalc.htm in the same directory as the program.
-+n Adds n days to Date (examples: -+3 (add 3 days), -+-1 (add -1 days).
(use -dp: to add months or years
-a return absolute value for date difference calculations
-bd:base date for date number modes (default is 0)
-df:stringchange date format used to write dates.
Uses settings from the control panel by default.
If -sdf option is given, and -df is not, -sdf format is used.
If -df option is given, -l and -s are ignored.
stringis made using these characters.
-dp:day|month|year part, default: day example: -dp:year -+2 (adds 2 years to Date1)
d Displays the day as a number without a leading zero (1-31).
dd Displays the day as a number with a leading zero (01-31).
ddd Displays the day as an abbreviation (Sun-Sat).
dddd Displays the day as a full name (Sunday-Saturday).
ddddd Displays the date using control panel Short Date format.
dddddd Displays the date using control panel Long Date format.
m Displays the month as a number without a leading zero (1-12).
mm Displays the month as a number with a leading zero (01-12).
mmm Displays the month as an abbreviation (Jan-Dec).
mmmm Displays the month as a full name (January-December).
yy Displays the year as a two-digit number (00-99).
yyyy Displays the year as a four-digit number (0000-9999).
/ Displays the date separator specified in the control panel.
-iso use iso date format (same as -df:yyyy-mm-dd)
-l formatuse long format (same as -df:dddddd).
-n return number instead of day name for WeekDay.
-nth:n use with -wd: FirstDOM or LastDOM to return the Nth day of week.
-s formatuse short format (same as -df:ddddd).
-sdf:stringchange short date format used to parse and format dates.
(iso is same as yyyy-mm-dd)
(uses settings from the control panel by default)
-wd:1,2,3,4,5,6,7 specify WeekDays for output
WeekDays are applied to output date for FirstDOM, IsLastDOM, LastDOM
all other modes apply WeekDays to Date1.
example: -+1 -wd:2,3,4,5,6 returns next day that is Mon-Fri

Modes:

Calc
Returns the current date (or Date1, if given)
options may be used to add or subtract days, months, or years
and change output format. Same as Today.
DateDiff
Returns Date2 - Date1 in days
DateNumber
Returns Date1 number of days since day 1
DayNumber
Returns Date1 day of the month
FirstDOM
Returns the first day of the month of Date1.
use -wd:2 -Nth:2 FirstDOM (2nd Tues of the month)
Format
Returns formatted date(s) from standard input
This example read iso dates and reformats: DateCalc -sdf:iso Format
IsFirstDOM
Returns "first day of the month" if Date1 is the first day.
If output is redirected, the file will be 0 bytes if NOT first day.
use -wd:2 -Nth:2 IsLastDOM (2nd from last Tues of the month)
ERRORLEVEL is 1 if first day, 0 if not
IsLastDOM
Returns "last day of the month" if Date1 is last day.
If output is redirected, the file will be 0 bytes if NOT last day.
use -wd:2 -Nth:2 IsLastDOM (2nd from last Tues of the month)
ERRORLEVEL is 1 if last day, 0 if not
Julian
Returns Date1 number of days into year
LastDOM
Returns the last day of the month of Date1.
use -wd:2 -Nth:2 LastDOM (2nd from last Tues of the month)
MonthNumber
Returns Date1 month number
NumberDate
Returns Date corresponding to a number returned by DateNumber
Today
Same as Calc
WeekDay
Returns long day name:
Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
Use -s option to return short day:
Sun, Mon, Tue, Wed, Thu, Fri, Sat
Use -n option to return the number.
ERRORLEVEL is the number of the day of the week (Sunday = 1)
YearNumber
Returns Date1 year

Number returned is written to the standard output,
ERRORLEVEL is set to the number returned.

A command line syntax error sets ERRORLEVEL 255

DateCalc - Copyright (C) 2012, Incode Systems, Inc.
Version 0.9.6 www.incodesystems.com mailto:sales1To see complete usage type: DateCalc -? | MORE
To see full documentation type: DateCalc --help (or open DateCalc.htm)