Blinking snake

Day

NAME

day - Calculate day number from calendar dates and vice versa

SYNTAX

day [-h?vjuwIpV] <date(s)> ... ...

DESCRIPTION

Day calculates the number of the day of the year for any input date provided, or calculates the calendar date from a day number and year provided. With no arguments, it returns the day-number for the current date, and assumes the current date is Gregorian. Day numbering is from 1-366, not from 0-365 (like Unix).

To calculate the day number from a calendar date, day is restricted to the format mm/dd/yyyy. To calculate the calendar date from a day number and year, date is restricted to the format ddd/yyyy.

OPTIONS

-h
Help, stdout.
-?
Help, stderr.
-v
Verbose.
-j
Assume all dates input are in the Julian (Proleptic) Calendar, and calculate day numbers accordingly. The Gregorian Proleptic Calendar is assumed in the absence of this option.
-u
Input date must be in the format ddd/yyyy, where ddd is the day number in the year ranging from 1 to 366, and yyyy is the year.
-w
Show the day of the week (i.e., Sunday-Saturday) in the output.
-I<file>
Obtain dates/day numbers from <file> instead of from the command line.
-t
If day is reading from stdin or /dev/tty, and you have specified this option, it will prompt (“day: ”) before reading.
-V
Print version date and die.

EXAMPLES

$ date
Wed Nov 27 09:54:32 MST 1996
$ day
332
$ day -v
day:  11/27/1996 [11 27 1996]  Gregorian  (366 days).
		The day of the year 1996 is {332}.
$ day -w
Wednesday 332
$ day -vw
day:  11/27/1996 [11 27 1996]  Gregorian  (366 days).
		The day of the year 1996 is {332}, Wednesday.
$ day -jvw
day:  11/14/1996 [11 14 1996]  Julian  (366 days).
		The day of the year 1996 is {319}, Wednesday.
$ day -jwu 1/-4713
Sunday 01/01/-4713
$ day -jwu 1/4713b
Monday 01/01/4713 BC
$ day -jwu 200/4713
Friday 07/19/4713
$
  

BUGS & SPECIAL CONSIDERATIONS

The ? in the -? must be escaped (preceded by a \) to prevent interpretation as a metacharacter by some shells.

The -u option turns off verbose output (-v) even if you specify it.

SEE ALSO

ncal(I), easter(I), jug(I), weekday(I), jday(I), grj(I), devn(I)

PLATFORMS SUPPORTED

UnixWare®

AUTHOR

Ivan Van Laningham. If you would like the C source, email me.

Previous Page
Table of Contents
Next Page

Main web site:  http://www.pauahtun.org

Valid HTML 4.01 Transitional