xref: /freebsd/usr.bin/calendar/calendar.1 (revision 641a6cfb86023499caafe26a4d821a0b885cf00b)
1.\" Copyright (c) 1989, 1990, 1993
2.\"     The Regents of the University of California.  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.\" 4. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"     @(#)calendar.1  8.1 (Berkeley) 6/29/93
29.\" $FreeBSD$
30.\"
31.Dd June 13, 2002
32.Dt CALENDAR 1
33.Os
34.Sh NAME
35.Nm calendar
36.Nd reminder service
37.Sh SYNOPSIS
38.Nm
39.Op Fl A Ar num
40.Op Fl a
41.Op Fl B Ar num
42.Op Fl D Ar moon|sun
43.Op Fl d
44.Op Fl F Ar friday
45.Op Fl f Ar calendarfile
46.Op Fl l Ar longitude
47.Oo
48.Bk -words
49.Fl t Ar dd Ns
50.Sm off
51.Op . Ar mm Op . Ar year
52.Sm on
53.Ek
54.Oc
55.Op Fl U Ar UTC-offset
56.Op Fl W Ar num
57.Sh DESCRIPTION
58The
59.Nm
60utility checks the current directory for a file named
61.Pa calendar
62and displays lines that fall into the specified date range.
63On the day before a weekend (normally Friday), events for the next
64three days are displayed.
65.Pp
66The following options are available:
67.Bl -tag -width Ds
68.It Fl A Ar num
69Print lines from today and the next
70.Ar num
71days (forward, future).
72.It Fl a
73Process the ``calendar'' files of all users and mail the results
74to them.
75This requires super-user privileges.
76.It Fl B Ar num
77Print lines from today and the previous
78.Ar num
79days (backward, past).
80.It Fl D Ar moon|sun
81Print UTC offset, longitude and moon or sun information.
82.It Fl d
83Debug option: print current date information.
84.It Fl F Ar friday
85Specify which day of the week is ``Friday'' (the day before the
86weekend begins).
87Default is 5.
88.It Fl f Pa calendarfile
89Use
90.Pa calendarfile
91as the default calendar file.
92.It Fl l Ar longitude
93Perform lunar and solar calculations from this longitude.
94If neither longitude nor UTC offset is specified, the calculations will
95be based on the difference between UTC time and localtime.
96If both are specified, UTC offset overrides longitude.
97.It Xo Fl t
98.Sm off
99.Ar dd
100.Op . Ar mm Op . Ar year
101.Sm on
102.Xc
103For test purposes only: set date directly to argument values.
104.It Fl U Ar UTC-offset
105Perform lunar and solar calculations from this UTC offset.
106If neither UTC offset nor longitude is specified, the calculations
107will be based on the difference between UTC time and localtime.
108If both are specified, UTC offset overrides longitude.
109.It Fl W Ar num
110Print lines from today and the next
111.Ar num
112days (forward, future).
113Ignore weekends when calculating the number of days.
114.El
115.Sh FILE FORMAT
116To handle calendars in your national code table you can specify
117.Dq LANG=<locale_name>
118in the calendar file as early as possible.
119.Pp
120To handle the local name of sequences, you can specify them as:
121.Dq SEQUENCE=<first> <second> <third> <fourth> <fifth> <last>
122in the calendar file as early as possible.
123.Pp
124The names of the following special days are recognized:
125.Bl -tag -width 123456789012345 -compact
126.It Easter
127Catholic Easter.
128.It Paskha
129Orthodox Easter.
130.It NewMoon
131The lunar New Moon.
132.It FullMoon
133The lunar Full Moon.
134.It MarEquinox
135The solar equinox in March.
136.It JunSolstice
137The solar solstice in June.
138.It SepEquinox
139The solar equinox in September.
140.It DecSolstice
141The solar solstice in December.
142.It ChineseNewYear
143The first day of the Chinese year.
144.El
145These names may be reassigned to their local names via an assignment
146like
147.Dq Easter=Pasen
148in the calendar file.
149.Pp
150Other lines should begin with a month and day.
151They may be entered in almost any format, either numeric or as character
152strings.
153If the proper locale is set, national month and weekday
154names can be used.
155A single asterisk (``*'') matches every month.
156A day without a month matches that day of every week.
157A month without a day matches the first of that month.
158Two numbers default to the month followed by the day.
159Lines with leading tabs default to the last entered date, allowing
160multiple line specifications for a single date.
161.Pp
162The names of the recognized special days may be followed by a
163positive or negative integer, like:
164.Dq Easter+3
165or
166.Dq Paskha-4 .
167.Pp
168Weekdays may be followed by ``-4'' ...\& ``+5'' (aliases for
169last, first, second, third, fourth) for moving events like
170``the last Monday in April''.
171.Pp
172By convention, dates followed by an asterisk are not fixed, i.e., change
173from year to year.
174.Pp
175Day descriptions start after the first <tab> character in the line;
176if the line does not contain a <tab> character, it is not displayed.
177If the first character in the line is a <tab> character, it is treated as
178a continuation of the previous line.
179.Pp
180The ``calendar'' file is preprocessed by
181.Xr cpp 1 ,
182allowing the inclusion of shared files such as lists of company holidays or
183meetings.
184If the shared file is not referenced by a full pathname,
185.Xr cpp 1
186searches in the current (or home) directory first, and then in the
187directory
188.Pa /usr/share/calendar .
189Empty lines and lines protected by the C commenting syntax
190.Pq Li /* ... */
191are ignored.
192.Pp
193Some possible calendar entries (<tab> characters highlighted by
194\fB\et\fR sequence)
195.Bd -unfilled -offset indent
196LANG=C
197Easter=Ostern
198
199#include <calendar.usholiday>
200#include <calendar.birthday>
201
2026/15\fB\et\fRJune 15 (if ambiguous, will default to month/day).
203Jun. 15\fB\et\fRJune 15.
20415 June\fB\et\fRJune 15.
205Thursday\fB\et\fREvery Thursday.
206June\fB\et\fREvery June 1st.
20715 *\fB\et\fR15th of every month.
2082010/4/15\fB\et\fR15 April 2010
209
210May Sun+2\fB\et\fRsecond Sunday in May (Muttertag)
21104/SunLast\fB\et\fRlast Sunday in April,
212\fB\et\fRsummer time in Europe
213Easter\fB\et\fREaster
214Ostern-2\fB\et\fRGood Friday (2 days before Easter)
215Paskha\fB\et\fROrthodox Easter
216
217.Ed
218.Sh FILES
219.Bl -tag -width calendar.christian -compact
220.It Pa calendar
221file in current directory.
222.It Pa ~/.calendar
223.Pa calendar
224HOME directory.
225A chdir is done into this directory if it exists.
226.It Pa ~/.calendar/calendar
227calendar file to use if no calendar file exists in the current directory.
228.It Pa ~/.calendar/nomail
229do not send mail if this file exists.
230.El
231.Pp
232The following default calendar files are provided in
233.Pa /usr/share/calendars:
234.Pp
235.Bl -tag -width calendar.southafrica -compact
236.It Pa calendar.all
237File which includes all the default files.
238.It Pa calendar.australia
239Calendar of events in Australia.
240.It Pa calendar.birthday
241Births and deaths of famous (and not-so-famous) people.
242.It Pa calendar.christian
243Christian holidays.
244This calendar should be updated yearly by the local system administrator
245so that roving holidays are set correctly for the current year.
246.It Pa calendar.computer
247Days of special significance to computer people.
248.It Pa calendar.croatian
249Calendar of events in Croatia.
250.It Pa calendar.dutch
251Calendar of events in the Netherlands.
252.It Pa calendar.freebsd
253Birthdays of
254.Fx
255committers.
256.It Pa calendar.french
257Calendar of events in France.
258.It Pa calendar.german
259Calendar of events in Germany.
260.It Pa calendar.history
261Everything else, mostly U.S.\& historical events.
262.It Pa calendar.holiday
263Other holidays, including the not-well-known, obscure, and
264.Em really
265obscure.
266.It Pa calendar.judaic
267Jewish holidays.
268The entries for this calendar have been obtained from the port
269deskutils/hebcal.
270.It Pa calendar.music
271Musical events, births, and deaths.
272Strongly oriented toward rock 'n' roll.
273.It Pa calendar.newzealand
274Calendar of events in New Zealand.
275.It Pa calendar.russian
276Russian calendar.
277.It Pa calendar.southafrica
278Calendar of events in South Africa.
279.It Pa calendar.usholiday
280U.S.\& holidays.
281This calendar should be updated yearly by the local system administrator
282so that roving holidays are set correctly for the current year.
283.It Pa calendar.world
284Includes all calendar files except for national files.
285.El
286.Sh COMPATIBILITY
287The
288.Nm
289program previously selected lines which had the correct date anywhere
290in the line.
291This is no longer true, the date is only recognized when it occurs
292at the beginning of a line.
293.Sh SEE ALSO
294.Xr at 1 ,
295.Xr cpp 1 ,
296.Xr mail 1 ,
297.Xr cron 8
298.Sh HISTORY
299A
300.Nm
301command appeared in
302.At v7 .
303.Sh NOTES
304Chinese New Year is calculated at 120 degrees east of Greenwich,
305which roughly corresponds with the east coast of China.
306For people west of China, this might result that the start of Chinese
307New Year and the day of the related new moon might differ.
308.Pp
309The phases of the moon and the longitude of the sun are calculated
310against the local position which corresponds with 30 degrees times
311the time-difference towards Greenwich.
312.Pp
313The new and full moons are happening on the day indicated: They
314might happen in the time period in the early night or in the late
315evening.
316It doesn't indicate that they are starting in the night on that date.
317.Pp
318Because of minor differences between the output of the formulas
319used and other sources on the Internet, Druids and Werewolves should
320double-check the start and end time of solar and lunar events.
321.Sh BUGS
322The
323.Nm
324utility does not handle Jewish holidays.
325.Pp
326There is no possibility to properly specify the local position
327needed for solar and lunar calculations.
328