xref: /minix3/usr.bin/cal/cal.1 (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc.\"	$NetBSD: cal.1,v 1.21 2015/01/08 03:56:33 christos Exp $
2a99e83a2SThomas Cort.\"
3a99e83a2SThomas Cort.\" Copyright (c) 1989, 1990, 1993
4a99e83a2SThomas Cort.\"	The Regents of the University of California.  All rights reserved.
5a99e83a2SThomas Cort.\"
6a99e83a2SThomas Cort.\" This code is derived from software contributed to Berkeley by
7a99e83a2SThomas Cort.\" Kim Letkeman.
8a99e83a2SThomas Cort.\"
9a99e83a2SThomas Cort.\" Redistribution and use in source and binary forms, with or without
10a99e83a2SThomas Cort.\" modification, are permitted provided that the following conditions
11a99e83a2SThomas Cort.\" are met:
12a99e83a2SThomas Cort.\" 1. Redistributions of source code must retain the above copyright
13a99e83a2SThomas Cort.\"    notice, this list of conditions and the following disclaimer.
14a99e83a2SThomas Cort.\" 2. Redistributions in binary form must reproduce the above copyright
15a99e83a2SThomas Cort.\"    notice, this list of conditions and the following disclaimer in the
16a99e83a2SThomas Cort.\"    documentation and/or other materials provided with the distribution.
17a99e83a2SThomas Cort.\" 3. Neither the name of the University nor the names of its contributors
18a99e83a2SThomas Cort.\"    may be used to endorse or promote products derived from this software
19a99e83a2SThomas Cort.\"    without specific prior written permission.
20a99e83a2SThomas Cort.\"
21a99e83a2SThomas Cort.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22a99e83a2SThomas Cort.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23a99e83a2SThomas Cort.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24a99e83a2SThomas Cort.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25a99e83a2SThomas Cort.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26a99e83a2SThomas Cort.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27a99e83a2SThomas Cort.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28a99e83a2SThomas Cort.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29a99e83a2SThomas Cort.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30a99e83a2SThomas Cort.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31a99e83a2SThomas Cort.\" SUCH DAMAGE.
32a99e83a2SThomas Cort.\"
33a99e83a2SThomas Cort.\"     @(#)cal.1	8.2 (Berkeley) 4/28/95
34a99e83a2SThomas Cort.\"
35*0a6a1f1dSLionel Sambuc.Dd January 7, 2015
36a99e83a2SThomas Cort.Dt CAL 1
37a99e83a2SThomas Cort.Os
38a99e83a2SThomas Cort.Sh NAME
39a99e83a2SThomas Cort.Nm cal
40a99e83a2SThomas Cort.Nd displays a calendar
41a99e83a2SThomas Cort.Sh SYNOPSIS
42a99e83a2SThomas Cort.Nm
43a99e83a2SThomas Cort.Op Fl 3hjry
44a99e83a2SThomas Cort.Op Fl A Ar after
45a99e83a2SThomas Cort.Op Fl B Ar before
46*0a6a1f1dSLionel Sambuc.Op Fl C Ar context
47a99e83a2SThomas Cort.Op Fl d Ar day-of-week
48a99e83a2SThomas Cort.Op Fl R Ar reform-spec
49a99e83a2SThomas Cort.Op Oo Ar month Oc Ar year
50a99e83a2SThomas Cort.Sh DESCRIPTION
51a99e83a2SThomas Cort.Nm
52a99e83a2SThomas Cortdisplays a simple calendar.
53a99e83a2SThomas CortIf arguments are not specified,
54a99e83a2SThomas Cortthe current month is displayed.
55a99e83a2SThomas CortThe options are as follows:
56a99e83a2SThomas Cort.Bl -tag -width Ds
57a99e83a2SThomas Cort.It Fl 3
58a99e83a2SThomas CortSame as
59a99e83a2SThomas Cort.Dq Fl A Ar 1 Fl B Ar 1 .
60a99e83a2SThomas Cort.It Fl A Ar after
61a99e83a2SThomas CortDisplay
62a99e83a2SThomas Cort.Ar after
63a99e83a2SThomas Cortmonths after the specified month.
64a99e83a2SThomas Cort.It Fl B Ar before
65a99e83a2SThomas CortDisplay
66a99e83a2SThomas Cort.Ar before
67a99e83a2SThomas Cortmonths before the specified month.
68*0a6a1f1dSLionel Sambuc.It Fl C Ar context
69*0a6a1f1dSLionel SambucDisplay
70*0a6a1f1dSLionel Sambuc.Ar context
71*0a6a1f1dSLionel Sambucmonths before and after the specified month.
72a99e83a2SThomas Cort.It Fl d Ar day-of-week
73a99e83a2SThomas CortSpecifies the day of the week on which the calendar should start.
74a99e83a2SThomas CortValid values are 0 through 6, presenting Sunday through Saturday,
75a99e83a2SThomas Cortinclusively.
76a99e83a2SThomas CortThe default output starts on Sundays.
77a99e83a2SThomas Cort.It Fl h
78a99e83a2SThomas CortHighlight the current day, if present in the displayed calendar.
79a99e83a2SThomas CortIf output is to a terminal, then the appropriate terminal sequences
80a99e83a2SThomas Cortare used, otherwise overstriking is used.
81a99e83a2SThomas CortIf more than one
82a99e83a2SThomas Cort.Fl h
83a99e83a2SThomas Cortis used and output is to a terminal, the current date will be
84a99e83a2SThomas Corthighlighted in inverse video instead of bold.
85a99e83a2SThomas Cort.It Fl j
86a99e83a2SThomas CortDisplay Julian dates (days one-based, numbered from January 1).
87a99e83a2SThomas Cort.It Fl R Ar reform-spec
88a99e83a2SThomas CortSelects an alternate Gregorian reform point from the default of
89a99e83a2SThomas CortSeptember 3rd, 1752.
90a99e83a2SThomas CortThe
91a99e83a2SThomas Cort.Ar reform-spec
92a99e83a2SThomas Cortcan be selected by one of the built-in names (see
93a99e83a2SThomas Cort.Sx NOTES
94a99e83a2SThomas Cortfor a list) or by a date of the form YYYY/MM/DD.
95a99e83a2SThomas CortThe date and month may be omitted, provided that what is specified
96a99e83a2SThomas Cortuniquely selects a given built-in reform point.
97a99e83a2SThomas CortIf an exact date is specified, then that date is taken to be the first
98a99e83a2SThomas Cortmissing date of the Gregorian Reform to be applied.
99a99e83a2SThomas Cort.It Fl r
100a99e83a2SThomas CortDisplay the month in which the Gregorian Reform adjustment was
101a99e83a2SThomas Cortapplied, if no other
102a99e83a2SThomas Cort.Ar month
103a99e83a2SThomas Cortor
104a99e83a2SThomas Cort.Ar year
105a99e83a2SThomas Cortinformation is given.
106a99e83a2SThomas CortIf used in conjunction with
107a99e83a2SThomas Cort.Fl y ,
108a99e83a2SThomas Cortthen the entire year is displayed.
109a99e83a2SThomas Cort.It Fl y
110a99e83a2SThomas CortDisplay a calendar for the current year.
111a99e83a2SThomas Cort.El
112a99e83a2SThomas Cort.Pp
113a99e83a2SThomas CortIf no parameters are specified, the current month's calendar is
114a99e83a2SThomas Cortdisplayed.
115a99e83a2SThomas CortA single parameter specifies the year and optionally the month
116a99e83a2SThomas Cortin ISO format:
117a99e83a2SThomas Cort.Dq Li cal 2007-12
118a99e83a2SThomas CortTwo parameters denote the month (1 - 12) and year.
119a99e83a2SThomas CortNote that the century must be included in the year.
120a99e83a2SThomas Cort.Pp
121a99e83a2SThomas CortA year starts on Jan 1.
122a99e83a2SThomas Cort.Sh NOTES
123a99e83a2SThomas CortIn the USA and Great Britain the Gregorian Reformation occurred in 1752.
124a99e83a2SThomas CortBy this time, most countries had recognized the reformation (although a
125a99e83a2SThomas Cortfew did not recognize it until the 1900's.)
126a99e83a2SThomas CortEleven days following September 2, 1752 were eliminated by the reformation,
127a99e83a2SThomas Cortso the calendar for that month is a bit unusual.
128a99e83a2SThomas Cort.Pp
129a99e83a2SThomas CortIn view of the chaotic way the Gregorian calendar was adopted throughout
130a99e83a2SThomas Cortthe world in the years between 1582 and 1928 make sure to take into account
131a99e83a2SThomas Cortthe date of the Gregorian Reformation in your region if you are checking a
132a99e83a2SThomas Cortcalendar for a very old date.
133a99e83a2SThomas Cort.Pp
134a99e83a2SThomas Cort.Nm
135a99e83a2SThomas Corthas a decent built-in list of Gregorian Reform dates and the names of
136a99e83a2SThomas Cortthe countries where the reform was adopted:
137a99e83a2SThomas Cort.Pp
138a99e83a2SThomas Cort.Bd -literal
139a99e83a2SThomas Cort	Italy		Oct.  5, 1582	Denmark		Feb. 19, 1700
140a99e83a2SThomas Cort	Spain		Oct.  5, 1582	Great Britain	Sep.  3, 1752
141a99e83a2SThomas Cort	Portugal	Oct.  5, 1582	Sweden		Feb. 18, 1753
142a99e83a2SThomas Cort	Poland		Oct.  5, 1582	Finland		Feb. 18, 1753
143a99e83a2SThomas Cort	France		Dec. 12, 1582	Japan		Dec. 20, 1872
144a99e83a2SThomas Cort	Luxembourg	Dec. 22, 1582	China		Nov.  7, 1911
145a99e83a2SThomas Cort	Netherlands	Dec. 22, 1582	Bulgaria	Apr.  1, 1916
146a99e83a2SThomas Cort	Bavaria		Oct.  6, 1583	U.S.S.R.	Feb.  1, 1918
147a99e83a2SThomas Cort	Austria		Jan.  7, 1584	Serbia		Jan. 19, 1919
148a99e83a2SThomas Cort	Switzerland	Jan. 12, 1584	Romania		Jan. 19, 1919
149a99e83a2SThomas Cort	Hungary		Oct. 22, 1587	Greece		Mar. 10, 1924
150a99e83a2SThomas Cort	Germany		Feb. 19, 1700	Turkey		Dec. 19, 1925
151a99e83a2SThomas Cort	Norway		Feb. 19, 1700	Egypt		Sep. 18, 1928
152a99e83a2SThomas Cort.Ed
153a99e83a2SThomas Cort.Pp
154a99e83a2SThomas CortThe country known as
155a99e83a2SThomas Cort.Em Great Britain
156a99e83a2SThomas Cortcan also be referred to as
157a99e83a2SThomas Cort.Em England
158a99e83a2SThomas Cortsince that has less letters and no spaces in it.
159a99e83a2SThomas CortThis is meant only as a measure of expediency, not as a possible
160a99e83a2SThomas Cortslight to anyone involved.
161a99e83a2SThomas Cort.Sh HISTORY
162a99e83a2SThomas CortA
163a99e83a2SThomas Cort.Nm
164a99e83a2SThomas Cortcommand appeared in
165a99e83a2SThomas Cort.At v6 .
166