xref: /freebsd/usr.bin/ncal/ncal.1 (revision 1d0e1dac57c1874f21c85793acf1925c9bdca13d)
1.\" Copyright (c) 1997 Wolfgang Helbig
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd March 14, 2009
28.Dt CAL 1
29.Os
30.Sh NAME
31.Nm cal ,
32.Nm ncal
33.Nd displays a calendar and the date of Easter
34.Sh SYNOPSIS
35.Nm
36.Op Fl 3hjy
37.Op Fl A Ar number
38.Op Fl B Ar number
39.Oo
40.Op Ar month
41.Ar year
42.Oc
43.Nm
44.Op Fl 3hj
45.Op Fl A Ar number
46.Op Fl B Ar number
47.Fl m Ar month
48.Op Ar year
49.Nm ncal
50.Op Fl 3hjJpwy
51.Op Fl A Ar number
52.Op Fl B Ar number
53.Op Fl s Ar country_code
54.Oo
55.Op Ar month
56.Ar year
57.Oc
58.Nm ncal
59.Op Fl 3hJeo
60.Op Fl A Ar number
61.Op Fl B Ar number
62.Op Ar year
63.Sh DESCRIPTION
64The
65.Nm
66utility displays a simple calendar in traditional format and
67.Nm ncal
68offers an alternative layout, more options and the date of Easter.
69The new format is a little cramped but it makes a year fit
70on a 25x80 terminal.
71If arguments are not specified,
72the current month is displayed.
73.Pp
74The options are as follows:
75.Bl -tag -width indent
76.It Fl h
77Turns off highlighting of today.
78.It Fl J
79Display Julian Calendar, if combined with the
80.Fl e
81option, display date of Easter according to the Julian Calendar.
82.It Fl e
83Display date of Easter (for western churches).
84.It Fl j
85Display Julian days (days one-based, numbered from January 1).
86.It Fl m Ar month
87Display the specified
88.Ar month .
89If
90.Ar month
91is specified as a decimal number, it may be followed by the letter
92.Ql f
93or
94.Ql p
95to indicate the following or preceding month of that number,
96respectively.
97.It Fl o
98Display date of Orthodox Easter (Greek and Russian
99Orthodox Churches).
100.It Fl p
101Print the country codes and switching days from Julian to Gregorian
102Calendar as they are assumed by
103.Nm ncal .
104The country code as determined from the local environment is marked
105with an asterisk.
106.It Fl s Ar country_code
107Assume the switch from Julian to Gregorian Calendar at the date
108associated with the
109.Ar country_code .
110If not specified,
111.Nm ncal
112tries to guess the switch date from the local environment or
113falls back to September 2, 1752.
114This was when Great
115Britain and her colonies switched to the Gregorian Calendar.
116.It Fl w
117Print the number of the week below each week column.
118.It Fl y
119Display a calendar for the specified year.
120.It Fl b
121Switch to backwards compatibility mode (for debugging).
122.It Fl d Ar yyyy-mm-dd
123Use
124.Ar yyyy-mm-dd
125as the current date (for debugging of highlighting).
126.It Fl 3
127Display the previous, current and next month surrounding today.
128.It Fl A Ar number
129Display the
130.Ar number
131of months after the current month.
132.It Fl B Ar number
133Display the
134.Ar number
135of months before the current month.
136.El
137.Pp
138A single parameter specifies the year (1\(en9999) to be displayed;
139note the year must be fully specified:
140.Dq Li cal 89
141will
142.Em not
143display a calendar for 1989.  Two parameters denote the month and
144year; the month is either a number between 1 and 12, or a full or
145abbreviated name as specified by the current locale.  Month and
146year default to those of the current system clock and time zone (so
147.Dq Li cal -m 8
148will display a calendar for the month of August in the current
149year).
150.Pp
151A year starts on January 1.
152.Sh SEE ALSO
153.Xr calendar 3 ,
154.Xr strftime 3
155.Sh HISTORY
156A
157.Nm
158command appeared in
159.At v5 .
160The
161.Nm ncal
162command appeared in
163.Fx 2.2.6 .
164.Sh AUTHORS
165The
166.Nm ncal
167command and manual were written by
168.An Wolfgang Helbig Aq helbig@FreeBSD.org .
169.Sh BUGS
170The assignment of Julian\(enGregorian switching dates to country
171codes is historically naive for many countries.
172.Pp
173Not all options are compatible and using them in different orders
174will give varying results.
175