forked from johannesgerer/jburkardt-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
calendar_rd.html
217 lines (183 loc) · 5.16 KB
/
calendar_rd.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<html>
<head>
<title>
CALENDAR_RD - Calendrical Conversions
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
CALENDAR_RD <br> Calendrical Conversions
</h1>
<hr>
<p>
<b>CALENDAR_RD</b>
is a C++ program which
returns information about a given date,
by Edward Reingold, Nachum Dershowitz.
</p>
<p>
The program is interactive. The user enters <b>y</b>, <b>m</b> and <b>d</b>,
which represent the year, (numeric) month, and day of a given date. Note
that <b>y</b> must be positive. Also note that all dates are implicitly
using the Gregorian calendar, extended backwards indefinitely.
</p>
<p>
Given <b>date</b> = (<b>y</b>,<b>m</b>,<b>d</b>), the program returns
<ul>
<li>
the weekday;
</li>
<li>
the absolute date, that is, the number of days elapsed since
the Gregorian date of Sunday, December 31, 1 BC;
</li>
<li>
the (month/day/year) date in the Gregorian calendar
(this is simply (<b>m</b>,<b>d</b>,<b>y</b>);
</li>
<li>
the (month/day/year) date in the Julian calendar;
</li>
<li>
the (week/day/year) in the ISO calendar;
</li>
<li>
the (month/day/year) date in the Hebrew calendar;
</li>
<li>
the (month/day/year) date in the Islamic calendar;
</li>
</ul>
</p>
<p>
The program halts when a nonpositive value of <b>y</b> is entered.
</p>
<h3 align = "center">
Licensing:
</h3>
<p>
This code is in the public domain, but any use of it should publicly
acknowledge its source.
</p>
<h3 align = "center">
Languages:
</h3>
<p>
<b>CALENDAR_RD</b> is available in
<a href = "../../cpp_src/calendar_rd/calendar_rd.html">a C++ version</a>.
</p>
<h3 align = "center">
Related Data and Programs:
</h3>
<p>
<a href = "../../c_src/analemma/analemma.html">
ANALEMMA</a>,
a C program which
evaluates the equation of time, a formula for the difference between
the uniform 24 hour day and the actual position of the sun,
by Brian Tung.
</p>
<p>
<a href = "../../f_src/calendar_nyt/calendar_nyt.html">
CALENDAR_NYT</a>,
a FORTRAN90 library which
shows the correspondence between dates and the New York Times volume and
issue number;
</p>
<p>
<a href = "../../cpp_src/calpak/calpak.html">
CALPAK</a>,
a C++ library which
converts between dates as computed on various calendars.
</p>
<p>
<a href = "../../datasets/dates/dates.html">
DATES</a>,
a dataset directory which
contains lists of dates in various calendar systems.
</p>
<p>
<a href = "../../cpp_src/doomsday/doomsday.html">
DOOMSDAY</a>,
a C++ library which
is given the year, month and day of a date, and uses
John Conway's doomsday algorithm to determine the corresponding day of the week.
</p>
<p>
<a href = "../../cpp_src/weekday/weekday.html">
WEEKDAY</a>,
a C++ library which
determines the day of the week for a given day.
</p>
<h3 align = "center">
Author:
</h3>
<p>
Edward Reingold, Nachum Dershowitz.
</p>
<h3 align = "center">
Reference:
</h3>
<p>
<ol>
<li>
Edward Reingold, Nachum Dershowitz,<br>
Calendrical Calculations: The Millennium Edition,<br>
Cambridge University Press, 2001,<br>
ISBN: 0-521-77752-6,<br>
LC: CE12.R45.
</li>
<li>
Edward Reingold, Nachum Dershowitz,<br>
Calendrical Calculations I,<br>
Software - Practice and Experience,<br>
Volume 20, Number 9, September 1990, pages 899-928.<br>
</li>
<li>
Edward Reingold, Nachum Dershowitz, Stewart Clamen,<br>
Calendrical Calculations, II: Three Historical Calendars,<br>
Software - Practice and Experience,<br>
Volume 23, Number 4, pages 383-404, April 1993.
</li>
</ol>
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "calendar_rd.cpp">calendar_rd.cpp</a>, the source code;
</li>
<li>
<a href = "calendar_rd.sh">calendar_rd.sh</a>,
commands to compile the source code;
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
<ul>
<li>
<a href = "calendar_rd_input.txt">calendar_rd_input.txt</a>,
the input file.
</li>
<li>
<a href = "calendar_rd_output.txt">calendar_rd_output.txt</a>,
the output file.
</li>
</ul>
</p>
<p>
You can go up one level to <a href = "../cpp_src.html">
the C++ source codes</a>.
</p>
<hr>
<i>
Last revised on 07 December 2008.
</i>
<!-- John Burkardt -->
</body>
</html>