DATECALC(1)                                                        DATECALC(1)



NAME
       datecalc - compute with times

SYNOPSIS
       datecalc [-v] [-o format] -a date time
       datecalc [-v] -c date date
       datecalc [-v] -c time time
       datecalc [-v] -d time scalar
       datecalc [-v] [-o format] -e scalar
       datecalc [-v] [-o format] -f date
       datecalc [-v] -m time scalar
       datecalc [-v] -n time
       datecalc [-v] [-o format] -p date
       datecalc [-v] [-o format] -s date time
       datecalc [-v] -t date
       datecalc [-v] -y time
       datecalc -h
       datecalc -V

DESCRIPTION
       Datecalc  outputs  a  value  computed from the command line expression.
       There are three different specifications allowed in an expression:

       date
              A date is either the output of the date(1) command,  or  one  of
              the words now, today, yesterday, or tomorrow.  Some other repre-
              sentations of a date are parsed: all of them must  be  contained
              in  a single shell word.  For example ctime(3) output is a valid
              date.

       times
              A timeu is an  integer number followed by  a  unit.   Units  are
              hours, minutes, days, weeks, fortnights, years, or leapyears and
              may be abbreviated to their first letter.  A time  can  be  fol-
              lowed by another time, as a shell word; the result is the sum of
              the times (e.g. "2y1w" is 2 years 1 week).

       scaler
              A scaler is an integer with no time unit on the end.

       In addition to these types the output may simply be an exit code (0 for
       success, 1 for failure).

OPTIONS
       -a
              Add a time to a date [to get a date].

       -c
              Compare two dates or times [to get an exit code].

       -d
              Divide a time by a scalar [to get a time].

       -e
              Convert seconds since the epoch to a date.

       -f
              Convert a free format date to fixed format date.

       -h
              Print only a brief help message.

       -m
              Multiply a time by a scalar [to get a time].

       -n
              Convert a time to scalar seconds.

       -o format
              Specify  the  output  format for any computed date (as per strf-
              time(3)).

       -p
              Convert a date to scalar seconds since the epoch.

       -s
              Subtract a time from a date [to get a date].

       -t
              Convert a free format date to at(1) format.

       -v
              Be verbose by announcing what operation we are about to do.

       -V
              Show only the standerd version banner.

       -y
              Convert a time to years days hours minutes  seconds  [to  get  a
              time with units as English words].

EXAMPLES
       datecalc -o %Y -a 1d "'date'"
              Output tomorrow's year.

       datecalc -o %Y tomorrow
              Output tomorrow's year, a little faster.

       datecalc yesterday
              Output what date(1) might have output yesterday.

       datecalc "15 Feb 2009"
              Output the given date in the standard format.

       datecalc -y "2y1l2f6h"
              Output  "3  Years  29  Days 6 Hours", which is more legible, and
              more accurate than "3 years 1 month".

BUGS
       Poorly documented (to say the least).  Infix  or  prefix  command  line
       options would be far more useful.

       It usually takes more than one datecalc command to get what you want.

AUTHOR
       Mike MacKenzie and KS Braunsdorf
       NPC Guild UNIX Support, rpm at ksb.npcguild.org.nospam

SEE ALSO
       sh(1), strftime(3), at(1), date(1), ctime(3)



                                     LOCAL                         DATECALC(1)

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXAMPLES | BUGS | AUTHOR | SEE ALSO