1998-08-10 16:42:37 -03:00
|
|
|
\section{\module{calendar} ---
|
2000-04-03 17:13:55 -03:00
|
|
|
General calendar-related functions}
|
1998-04-28 11:28:57 -03:00
|
|
|
|
2000-04-03 17:13:55 -03:00
|
|
|
\declaremodule{standard}{calendar}
|
|
|
|
\modulesynopsis{General functions for working with the calendar,
|
|
|
|
including some emulation of the \UNIX{} \program{cal}
|
|
|
|
program.}
|
|
|
|
\sectionauthor{Drew Csillag}{drew_csillag@geocities.com}
|
1998-04-28 11:28:57 -03:00
|
|
|
|
|
|
|
This module allows you to output calendars like the \UNIX{}
|
2000-04-03 17:13:55 -03:00
|
|
|
\program{cal} program, and provides additional useful functions
|
|
|
|
related to the calendar.
|
1998-04-28 11:28:57 -03:00
|
|
|
|
|
|
|
\begin{funcdesc}{isleap}{year}
|
2000-04-03 17:13:55 -03:00
|
|
|
Returns true if \var{year} is a leap year.
|
1998-04-28 11:28:57 -03:00
|
|
|
\end{funcdesc}
|
|
|
|
|
|
|
|
\begin{funcdesc}{leapdays}{year1, year2}
|
|
|
|
Return the number of leap years in the range
|
|
|
|
[\var{year1}\ldots\var{year2}].
|
|
|
|
\end{funcdesc}
|
|
|
|
|
|
|
|
\begin{funcdesc}{weekday}{year, month, day}
|
|
|
|
Returns the day of the week (\code{0} is Monday) for \var{year}
|
1998-05-08 12:39:40 -03:00
|
|
|
(\code{1970}--\ldots), \var{month} (\code{1}--\code{12}), \var{day}
|
1998-04-28 11:28:57 -03:00
|
|
|
(\code{1}--\code{31}).
|
|
|
|
\end{funcdesc}
|
|
|
|
|
|
|
|
\begin{funcdesc}{monthrange}{year, month}
|
|
|
|
Returns weekday of first day of the month and number of days in month,
|
|
|
|
for the specified \var{year} and \var{month}.
|
|
|
|
\end{funcdesc}
|
|
|
|
|
|
|
|
\begin{funcdesc}{monthcalendar}{year, month}
|
|
|
|
Returns a matrix representing a month's calendar. Each row represents
|
|
|
|
a week; days outside of the month a represented by zeros.
|
|
|
|
\end{funcdesc}
|
|
|
|
|
|
|
|
\begin{funcdesc}{prmonth}{year, month\optional{, width\optional{, length}}}
|
|
|
|
Prints a month's calendar. If \var{width} is provided, it specifies
|
|
|
|
the width of the columns that the numbers are centered in. If
|
|
|
|
\var{length} is given, it specifies the number of lines that each
|
|
|
|
week will use.
|
|
|
|
\end{funcdesc}
|
|
|
|
|
|
|
|
\begin{funcdesc}{prcal}{year}
|
|
|
|
Prints the calendar for the year \var{year}.
|
|
|
|
\end{funcdesc}
|
1999-06-09 12:11:58 -03:00
|
|
|
|
|
|
|
\begin{funcdesc}{timegm}{tuple}
|
2000-04-03 17:13:55 -03:00
|
|
|
An unrelated but handy function that takes a time tuple such as
|
|
|
|
returned by the \function{gmtime()} function in the \refmodule{time}
|
1999-06-09 12:11:58 -03:00
|
|
|
module, and returns the corresponding Unix timestamp value, assuming
|
|
|
|
an epoch of 1970, and the POSIX encoding. In fact,
|
2000-04-03 17:13:55 -03:00
|
|
|
\function{time.gmtime()} and \function{timegm()} are each others' inverse.
|
1999-06-09 12:11:58 -03:00
|
|
|
\end{funcdesc}
|
2000-04-03 17:13:55 -03:00
|
|
|
|
|
|
|
|
|
|
|
\begin{seealso}
|
|
|
|
\seemodule{time}{Low-level time related functions.}
|
|
|
|
\end{seealso}
|