Section: User Commands (1)
Updated: 25 July 2008
ccal - display a calendar together with Chinese calendar
] [ [
utility writes a Gregorian calendar together with Chinese calendar
to standard output.
operand is specified, a calendar for that year is written.
If no operands are specified, a calendar for the current month is written.
By default, ASCII mode is used for the output.
Generates Encapsulated PostScript output which can be redirected into a
file. Although the file can be directly printed, the intention is to
have it embedded in other documents to make do-it-yourself calendars.
Generates HTML table output which can be redirected into a file to be
viewed by a web browser or customized to be part of a web page. To view
such a page, a properly installed Chinese font is required.
Generates XML output which can be redirected into a file to be
processed by XSLT or XSL-FO processor to generate calendars with
custom appearance. Assumes UTF-8 encoding.
Outputs simplified Chinese characters. Defaults to GB encoding in
character or HTML modes.
This is the default if either
option is selected.
Outputs traditional Chinese characters. Defaults to Big5 encoding in
character or HTML modes.
Outputs Chinese characters in UTF-8 encoding rathern than GB or Big5.
No effect in Encapsulated PostScript mode.
The following operands are supported:
Specify the month to be displayed, represented as a decimal integer from
The default is the current month.
Specify the year for which the calendar is displayed,
represented as a decimal integer from
However, accuracy will gradually decrease beyond 300 years
from Year 2000. The default is the current year.
The following exit values are returned:
An error occurred.
The marking of lunar month(s) in month header refers to new lunar
month(s) to start in that month unless there is no new lunar month
in that calendar month in which case the marking refers to the current
running lunar month. This special case will only happen occasionally
in February. To reduce the confusion on to which lunar month a day
belongs, the month header also shows the starting date(s) of any new
lunar month(s) in the calendar month.
In the default ASCII mode, a letter "R" before the lunar month number in month
header indicates that the lunar month is a leap ("run") month. The letter
after that number shows whether the lunar month is a long ("da") month, with
"D", or a short ("xiao") month, with "X". The starting date of that new lunar
month will follow after a space and begins with "S", e.g. "S26" means
this new lunar month starts on 26th of the calendar month. Inside the actual
calendar, a letter "Y" indicates the starting of the numbered lunar month.
An additional "R" indicates that lunar month is a leap month.
solar terms ("jieqi") are coded with initials of the pinyin of
Chinese characters are used directly if options
are used or in PostScript, XML
or HTML modes. Should a solar term and a new lunar month fall
on the same day, the marking of the new lunar month is moved
to the next day for character modes. In the other modes, new lunar
month and solar term are marked together in that order.
The Chinese calendar was last reformed in 1645. The
current algorithm is based on the true motions of the
sun and the moon. The mean sun and/or moon motions were
used before that.
The algorithm to compute the motion of the sun is adapted
from the NOVAS-C package from the U.S. Naval Observatory.
The algorithm to compute the motion of the moon is from the
Lunar Outreach Services which is in turn based on Meeus.
http://www.lunaroutreach.org/phases/phases.cgi (no longer available)
In Year 2033, a very rare leap 11th month will be added in December.
Due to less accurate algorithms, people used to think that the leap
month should be added after the 7th month before early
1990s. To see this calendar, type:
ccal 12 2033
- EXIT STATUS
- SEE ALSO
Back to Make Your Own Chinese Calendar
Created by: Zhuo Meng (firstname.lastname@example.org) from manual pages using man2html.
Usual disclaimer applies