]> git.ipfire.org Git - thirdparty/util-linux.git/blob - misc-utils/cal.1.adoc
autotools: add missing dist_noinst_DATA
[thirdparty/util-linux.git] / misc-utils / cal.1.adoc
1 //po4a: entry man manual
2 ////
3 Copyright (c) 1989, 1990, 1993
4 The Regents of the University of California. All rights reserved.
5
6 This code is derived from software contributed to Berkeley by
7 Kim Letkeman.
8
9 Redistribution and use in source and binary forms, with or without
10 modification, are permitted provided that the following conditions
11 are met:
12 1. Redistributions of source code must retain the above copyright
13 notice, this list of conditions and the following disclaimer.
14 2. Redistributions in binary form must reproduce the above copyright
15 notice, this list of conditions and the following disclaimer in the
16 documentation and/or other materials provided with the distribution.
17 3. All advertising materials mentioning features or use of this software
18 must display the following acknowledgement:
19 This product includes software developed by the University of
20 California, Berkeley and its contributors.
21 4. Neither the name of the University nor the names of its contributors
22 may be used to endorse or promote products derived from this software
23 without specific prior written permission.
24
25 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 SUCH DAMAGE.
36
37 @(#)cal.1 8.1 (Berkeley) 6/6/93
38 ////
39 = cal(1)
40 :doctype: manpage
41 :man manual: User Commands
42 :man source: util-linux {release-version}
43 :page-layout: base
44 :command: cal
45 :plus: +
46
47 == NAME
48
49 cal - display a calendar
50
51 == SYNOPSIS
52
53 *cal* [options] [[[_day_] _month_] _year_]
54
55 *cal* [options] [_timestamp_|_monthname_]
56
57 == DESCRIPTION
58
59 *cal* displays a simple calendar. If no arguments are specified, the current month is displayed.
60
61 The _month_ may be specified as a number (1-12), as a month name or as an abbreviated month name according to the current locales.
62
63 Two different calendar systems are used, Gregorian and Julian. These are nearly identical systems with Gregorian making a small adjustment to the frequency of leap years; this facilitates improved synchronization with solar events like the equinoxes. The Gregorian calendar reform was introduced in 1582, but its adoption continued up to 1923. By default *cal* uses the adoption date of 3 Sept 1752. From that date forward the Gregorian calendar is displayed; previous dates use the Julian calendar system. 11 days were removed at the time of adoption to bring the calendar in sync with solar events. So Sept 1752 has a mix of Julian and Gregorian dates by which the 2nd is followed by the 14th (the 3rd through the 13th are absent).
64
65 Optionally, either the proleptic Gregorian calendar or the Julian calendar may be used exclusively. See *--reform* below.
66
67 == OPTIONS
68
69 *-1*, *--one*::
70 Display single month output. (This is the default.)
71
72 *-3*, *--three*::
73 Display three months spanning the date.
74
75 *-n , --months* _number_::
76 Display _number_ of months, starting from the month containing the date.
77
78 *-S, --span*::
79 Display months spanning the date.
80
81 *-s*, *--sunday*::
82 Display Sunday as the first day of the week.
83
84 *-m*, *--monday*::
85 Display Monday as the first day of the week.
86
87 *-v*, *--vertical*::
88 Display using a vertical layout (aka *ncal*(1) mode).
89
90 *--iso*::
91 Display the proleptic Gregorian calendar exclusively. This option does not affect week numbers and the first day of the week. See *--reform* below.
92
93 *-j*, *--julian*::
94 Use day-of-year numbering for all calendars. These are also called ordinal days. Ordinal days range from 1 to 366. This option does not switch from the Gregorian to the Julian calendar system, that is controlled by the *--reform* option.
95 +
96 Sometimes Gregorian calendars using ordinal dates are referred to as Julian calendars. This can be confusing due to the many date related conventions that use Julian in their name: (ordinal) julian date, julian (calendar) date, (astronomical) julian date, (modified) julian date, and more. This option is named julian, because ordinal days are identified as julian by the POSIX standard. However, be aware that *cal* also uses the Julian calendar system. See *DESCRIPTION* above.
97
98 *--reform* _val_::
99 This option sets the adoption date of the Gregorian calendar reform. Calendar dates previous to reform use the Julian calendar system. Calendar dates after reform use the Gregorian calendar system. The argument _val_ can be:
100 +
101 * _1752_ - sets 3 September 1752 as the reform date (default). This is when the Gregorian calendar reform was adopted by the British Empire.
102 * _gregorian_ - display Gregorian calendars exclusively. This special placeholder sets the reform date below the smallest year that *cal* can use; meaning all calendar output uses the Gregorian calendar system. This is called the proleptic Gregorian calendar, because dates prior to the calendar system's creation use extrapolated values.
103 * _iso_ - alias of _gregorian_. The ISO 8601 standard for the representation of dates and times in information interchange requires using the proleptic Gregorian calendar.
104 * _julian_ - display Julian calendars exclusively. This special placeholder sets the reform date above the largest year that *cal* can use; meaning all calendar output uses the Julian calendar system.
105 +
106 See *DESCRIPTION* above.
107
108 *-y*, *--year*::
109 Display a calendar for the whole year.
110
111 *-Y, --twelve*::
112 Display a calendar for the next twelve months.
113
114 *-w*, *--week*[=_number_]::
115 Display week numbers in the calendar (US or ISO-8601). See the *NOTES* section for more details.
116
117 *--color*[=_when_]::
118 Colorize the output. The optional argument _when_ can be *auto*, *never* or *always*. If the _when_ argument is omitted, it defaults to *auto*. The colors can be disabled; for the current built-in default see the *--help* output. See also the *COLORS* section.
119
120 *-c, --columns*=_columns_::
121 Number of columns to use. *auto* uses as many as fit the terminal.
122
123 include::man-common/help-version.adoc[]
124
125 == PARAMETERS
126
127 *Single digits-only parameter (e.g., 'cal 2020')*::
128 Specifies the _year_ to be displayed; note the year must be fully specified: *cal 89* will not display a calendar for 1989.
129
130 *Single string parameter (e.g., 'cal tomorrow' or 'cal August')*::
131 Specifies _timestamp_ or a _month name_ (or abbreviated name) according to the current locales.
132 +
133 The special placeholders are accepted when parsing timestamp, "now" may be used to refer to the current time, "today", "yesterday", "tomorrow" refer to of the current day, the day before or the next day, respectively.
134 +
135 The relative date specifications are also accepted, in this case "{plus}" is evaluated to the current time plus the specified time span. Correspondingly, a time span that is prefixed with "-" is evaluated to the current time minus the specified time span, for example '{plus}2days'. Instead of prefixing the time span with "{plus}" or "-", it may also be suffixed with a space and the word "left" or "ago" (for example '1 week ago').
136 //TRANSLATORS: Please keep {plus} untranslated.
137
138 *Two parameters (e.g., 'cal 11 2020')*::
139 Denote the _month_ (1 - 12) and _year_.
140
141 *Three parameters (e.g., 'cal 25 11 2020')*::
142 Denote the _day_ (1-31), _month and year_, and the day will be highlighted if the calendar is displayed on a terminal. If no parameters are specified, the current month's calendar is displayed.
143
144 == NOTES
145
146 A year starts on January 1. The first day of the week is determined by the locale or the *--sunday* and *--monday* options.
147
148 The week numbering depends on the choice of the first day of the week. If it is Sunday then the customary North American numbering is used, where 1 January is in week number 1. If it is Monday (*-m*) then the ISO 8601 standard week numbering is used, where the first Thursday is in week number 1.
149
150 include::man-common/colors.adoc[]
151 The logical color names supported by *cal* are:
152
153 *today*::
154 The current day.
155
156 *weeknumber*::
157 The number of the week.
158
159 *header*::
160 The header of a month.
161
162 *workday*::
163 Days that fall within the work-week.
164
165 *weekend*::
166 Days that fall outside the work-week.
167
168 For example:
169 ____
170 echo -e 'weekend 35\ntoday 1;41\nheader yellow' > $HOME/.config/terminal-colors.d/cal.scheme
171 ____
172
173 == HISTORY
174
175 A *cal* command appeared in Version 6 AT&T UNIX.
176
177 == BUGS
178
179 The default *cal* output uses 3 September 1752 as the Gregorian calendar reform date. The historical reform dates for the other locales, including its introduction in October 1582, are not implemented.
180
181 Alternative calendars, such as the Umm al-Qura, the Solar Hijri, the Ge'ez, or the lunisolar Hindu, are not supported.
182
183 == SEE ALSO
184
185 *terminal-colors.d*(5)
186
187 include::man-common/bugreports.adoc[]
188
189 include::man-common/footer.adoc[]
190
191 ifdef::translation[]
192 include::man-common/translation.adoc[]
193 endif::[]