xref: /freebsd/usr.bin/ncal/ncal.1 (revision 608da65de9552d5678c1000776ed69da04a45983)
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.Dd March 7, 2019
26.Dt CAL 1
27.Os
28.Sh NAME
29.Nm cal ,
30.Nm ncal
31.Nd displays a calendar and the date of Easter
32.Sh SYNOPSIS
33.Nm
34.Op Fl 3hjy
35.Op Fl A Ar number
36.Op Fl B Ar number
37.Oo
38.Op Ar month
39.Ar year
40.Oc
41.Nm
42.Op Fl 3hj
43.Op Fl A Ar number
44.Op Fl B Ar number
45.Fl m Ar month
46.Op Ar year
47.Nm ncal
48.Op Fl 3hjJpwy
49.Op Fl A Ar number
50.Op Fl B Ar number
51.Op Fl s Ar country_code
52.Oo
53.Op Ar month
54.Ar year
55.Oc
56.Nm ncal
57.Op Fl 3hJeo
58.Op Fl A Ar number
59.Op Fl B Ar number
60.Op Ar year
61.Nm ncal
62.Op Fl CN
63.Op Fl H Ar yyyy-mm-dd
64.Op Fl d Ar yyyy-mm
65.Sh DESCRIPTION
66The
67.Nm
68utility displays a simple calendar in traditional format and
69.Nm ncal
70offers an alternative layout, more options and the date of Easter.
71The new format is a little cramped but it makes a year fit
72on a 25x80 terminal.
73If arguments are not specified,
74the current month is displayed.
75.Pp
76The options are as follows:
77.Bl -tag -width indent
78.It Fl h
79Turns off highlighting of today.
80.It Fl J
81Display Julian Calendar, if combined with the
82.Fl e
83option, display date of Easter according to the Julian Calendar.
84.It Fl e
85Display date of Easter (for western churches).
86.It Fl j
87Display Julian days (days one-based, numbered from January 1).
88.It Fl m Ar month
89Display the specified
90.Ar month .
91If
92.Ar month
93is specified as a decimal number, it may be followed by the letter
94.Ql f
95or
96.Ql p
97to indicate the following or preceding month of that number,
98respectively.
99.It Fl o
100Display date of Orthodox Easter (Greek and Russian
101Orthodox Churches).
102.It Fl p
103Print the country codes and switching days from Julian to Gregorian
104Calendar as they are assumed by
105.Nm ncal .
106The country code as determined from the local environment is marked
107with an asterisk.
108.It Fl s Ar country_code
109Assume the switch from Julian to Gregorian Calendar at the date
110associated with the
111.Ar country_code .
112If not specified,
113.Nm ncal
114tries to guess the switch date from the local environment or
115falls back to September 2, 1752.
116This was when Great
117Britain and her colonies switched to the Gregorian Calendar.
118.It Fl w
119Print the number of the week below each week column.
120.It Fl y
121Display a calendar for the specified year.
122.It Fl 3
123Display the previous, current and next month surrounding today.
124.It Fl A Ar number
125Display the
126.Ar number
127of months after the current month.
128.It Fl B Ar number
129Display the
130.Ar number
131of months before the current month.
132.It Fl C
133Switch to
134.Nm cal
135mode.
136.It Fl N
137Switch to
138.Nm ncal
139mode.
140.It Fl d Ar yyyy-mm
141Use
142.Ar yyyy-mm
143as the current date (for debugging of date selection).
144.It Fl H Ar yyyy-mm-dd
145Use
146.Ar yyyy-mm-dd
147as the current date (for debugging of highlighting).
148.El
149.Pp
150A single parameter specifies the year (1\(en9999) to be displayed;
151note the year must be fully specified:
152.Dq Li cal 89
153will
154.Em not
155display a calendar for 1989.
156Two parameters denote the month and
157year; the month is either a number between 1 and 12, or a full or
158abbreviated name as specified by the current locale.
159Month and
160year default to those of the current system clock and time zone (so
161.Dq Li cal -m 8
162will display a calendar for the month of August in the current
163year).
164.Pp
165Not all options can be used together.
166For example
167.Dq Li -3 -A 2 -B 3 -y -m 7
168would mean:
169show me the three months around the seventh month, three before
170that, two after that and the whole year.
171.Nm ncal
172will warn about these combinations.
173.Pp
174A year starts on January 1.
175.Pp
176Highlighting of dates is disabled if stdout is not a tty.
177.Sh SEE ALSO
178.Xr calendar 3 ,
179.Xr strftime 3
180.Sh STANDARDS
181The
182.Nm
183utility is compliant with the
184X/Open System Interfaces option of the
185.St -p1003.1-2008
186specification.
187.Pp
188The flags
189.Op Fl 3hyJeopw ,
190as well as the ability to specify a month name as a single argument,
191are extensions to that specification.
192.Pp
193The week number computed by
194.Fl w
195is compliant with the
196.St -iso8601
197specification.
198.Sh HISTORY
199A
200.Nm
201command appeared in
202.At v1 .
203The
204.Nm ncal
205command appeared in
206.Fx 2.2.6 .
207.Sh AUTHORS
208The
209.Nm ncal
210command and manual were written by
211.An Wolfgang Helbig Aq Mt helbig@FreeBSD.org .
212.Sh BUGS
213The assignment of Julian\(enGregorian switching dates to country
214codes is historically naive for many countries.
215.Pp
216Not all options are compatible and using them in different orders
217will give varying results.
218.Pp
219It is not possible to display Monday as the first day of the week with
220.Nm cal .
221