File: calendar.sgml

package info (click to toggle)
php3 1%3A3.0.5-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 8,348 kB
  • ctags: 9,086
  • sloc: ansic: 76,362; sh: 2,333; php: 1,329; yacc: 1,148; makefile: 970; perl: 763; cpp: 529; awk: 90; sql: 11
file content (340 lines) | stat: -rw-r--r-- 10,513 bytes parent folder | download
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
 
 <reference id="ref.calendar">
  <title>Calendar Functions</title>
  <titleabbrev>Calendar</titleabbrev>

  <partintro>
   <para>
    The calendar functions are only available if you have compiled the
    calendar extension in dl/calendar. Read dl/README for instructions on
    using it.
   </para>
   <para>
    The Calendar extension in PHP presents a series of functions to
    simplify converting between different calendar formats.  The
    intermediary or standard it is based on is the Julian Day Count.
    The Julian Day Count is a count of days starting way earlier than
    any date most people would need to track (somewhere around
    4000bc).  To convert between calendar systems, you must first
    convert to Julian Day Count, then to the calendar system of your
    choice.  Julian Day Count is very different from the Julian
    Calendar!  For more information on calendar systems visit <ulink
    url="http://genealogy.org/~scottlee/cal-overview.html">http://genealogy.org/~scottlee/cal-overview.html</ulink>.
    Excerpts from this page are included in these instructions, and
    are in quotes
  </partintro>

    <refentry id="function.jdtogregorian">
      <refnamediv>
	<refname>JDToGregorian</refname>
	<refpurpose>Converts Julian Day Count to Gregorian date</refpurpose>
      </refnamediv>
      <refsect1>
	<title>Description</title>
	<funcsynopsis>
          <funcdef>string <function>jdtogregorian</function></funcdef>
	  <paramdef>int <parameter>julianday</parameter></paramdef>
	</funcsynopsis>
        <para>
         Converts Julian Day Count to a string containing the
         Gregorian date in the format of "month/day/year"
      </refsect1>
    </refentry>

    <refentry id="function.gregoriantojd">
      <refnamediv>
	<refname>GregorianToJD</refname> 
        <refpurpose>Converts a Gregorian date to Julian Day
         Count</refpurpose>
      </refnamediv>
      <refsect1>
	<title>Description</title>
	<funcsynopsis>
	  <funcdef>int <function>gregoriantojd</function></funcdef>
	  <paramdef>int <parameter>month</parameter></paramdef>
	  <paramdef>int <parameter>day</parameter></paramdef>
	  <paramdef>int <parameter>year</parameter></paramdef>
	</funcsynopsis>
	<para>
         Valid Range for Gregorian Calendar 4714 B.C. to 9999 A.D.
        <para>
         Although this software can handle dates all the way back to
         4714 B.C., such use may not be meaningful. The Gregorian
         calendar was not instituted until October 15, 1582 (or
         October 5, 1582 in the Julian calendar). Some countries did
         not accept it until much later. For example, Britain
         converted in 1752, The USSR in 1918 and Greece in 1923. Most
         European countries used the Julian calendar prior to the
         Gregorian.

<example>
	    <title>Calendar functions</title>
	    <programlisting role=php>
&lt;?php
$jd = GregorianToJD(10,11,1970);
echo("$jd\n");
$gregorian = JDToGregorian($jd);
echo("$gregorian\n");
?>
</programlisting>
</example>

      </refsect1>
    </refentry>
 
    <refentry id="function.jdtojulian">
      <refnamediv>
	<refname>JDToJulian</refname> 
        <refpurpose>Converts a Julian Calendar date to Julian Day
 	 Count</refpurpose>
      </refnamediv>
      <refsect1>
	<title>Description</title>
	<funcsynopsis>
	  <funcdef>string <function>jdtojulian</function></funcdef>
	  <paramdef>int <parameter>julianday</parameter></paramdef>
	</funcsynopsis>
	<para>
         Converts Julian Day Count to a string containing the Julian
         Calendar Date in the format of "month/day/year".
      </refsect1>
    </refentry>

    <refentry id="function.juliantojd">
      <refnamediv>
	<refname>JulianToJD</refname> 
        <refpurpose>Converts a Julian Calendar date to Julian Day
         Count</refpurpose>
      </refnamediv>
      <refsect1>
	<title>Description</title>
	<funcsynopsis>
	  <funcdef>int <function>juliantojd</function></funcdef>
	  <paramdef>int <parameter>month</parameter></paramdef>
	  <paramdef>int <parameter>day</parameter></paramdef>
	  <paramdef>int <parameter>year</parameter></paramdef>
	</funcsynopsis>
        <para>
         Valid Range for Julian Calendar 4713 B.C. to 9999 A.D.
        <para>
         Although this software can handle dates all the way back to
         4713 B.C., such use may not be meaningful. The calendar was
         created in 46 B.C., but the details did not stabilize until
         at least 8 A.D., and perhaps as late at the 4th
         century. Also, the beginning of a year varied from one
         culture to another - not all accepted January as the first
         month.
      </refsect1>
    </refentry>

    <refentry id="function.jdtojewish">
      <refnamediv>
	<refname>JDToJewish</refname>
	<refpurpose>Converts a Julian Day Count to the Jewish
         Calendar</refpurpose>
      </refnamediv>
      <refsect1>
	<title>Description</title>
	<funcsynopsis>
	  <funcdef>string <function>jdtojewish</function></funcdef>
	  <paramdef>int <parameter>julianday</parameter></paramdef>
	</funcsynopsis>
        <para>
         Converts a Julian Day Count the the Jewish Calendar.
      </refsect1>
    </refentry>

    <refentry id="function.jewishtojd">
      <refnamediv>
	<refname>JewishToJD</refname> 
        <refpurpose>Converts a date in the Jewish Calendar to Julian
         Day Count</refpurpose>
      </refnamediv>
      <refsect1>
	<title>Description</title>
	<funcsynopsis>
	  <funcdef>int <function>jewishtojd</function></funcdef>
	  <paramdef>int <parameter>month</parameter></paramdef>
	  <paramdef>int <parameter>day</parameter></paramdef>
	  <paramdef>int <parameter>year</parameter></paramdef>
	</funcsynopsis>
        <para>
         Valid Range Although this software can handle dates all the
         way back to the year 1 (3761 B.C.), such use may not be
         meaningful.
        <para>
         The Jewish calendar has been in use for several thousand
         years, but in the early days there was no formula to
         determine the start of a month. A new month was started when
         the new moon was first observed.
      </refsect1>
    </refentry>

    <refentry id="function.jdtofrench">
      <refnamediv>
	<refname>JDToFrench</refname>
	<refpurpose>Converts a Julian Day Count to the French
         Republican Calendar</refpurpose>
      </refnamediv>
      <refsect1>
	<title>Description</title>
	<funcsynopsis>
	  <funcdef>string <function>jdtofrench</function></funcdef>
	  <paramdef>int <parameter>month</parameter></paramdef>
	  <paramdef>int <parameter>day</parameter></paramdef>
	  <paramdef>int <parameter>year</parameter></paramdef>
	</funcsynopsis>
        <para>
         Converts a Julian Day Count to the French Republican
         Calendar.
      </refsect1>
    </refentry>

    <refentry id="function.frenchtojd">
      <refnamediv>
	<refname>FrenchToJD</refname>
	<refpurpose>Converts a date from the French Republican
         Calendar to a Julian Day Count</refpurpose>
      </refnamediv>
      <refsect1>
	<title>Description</title>
	<funcsynopsis>
	  <funcdef>int <function>frenchtojd</function></funcdef>
	  <paramdef>int <parameter>month</parameter></paramdef>
	  <paramdef>int <parameter>day</parameter></paramdef>
	  <paramdef>int <parameter>year</parameter></paramdef>
	</funcsynopsis>
        <para>
	 Converts a date from the French Republican Calendar to a
	 Julian Day Count
        <para>
         These routines only convert dates in years 1 through 14
         (Gregorian dates 22 September 1792 through 22 September
         1806). This more than covers the period when the calendar was
         in use.
      </refsect1>
    </refentry>

    <refentry id="function.jdmonthname">
      <refnamediv>
	<refname>JDMonthName</refname>
	<refpurpose>Returns a month name</refpurpose>
      </refnamediv>
      <refsect1>
	<title>Description</title>
	<funcsynopsis>
	  <funcdef>string <function>jdmonthname</function></funcdef>
	  <paramdef>int <parameter>julianday</parameter></paramdef>
	  <paramdef>int <parameter>mode</parameter></paramdef>
	</funcsynopsis>
        <para>
         Returns a string containing a month name.
         <parameter>mode</parameter> tells this function which
         calendar to convert the Julian Day Count to, and what type of
         month names are to be returned.


     <table>
      <title>Calendar modes</title>
      <tgroup cols="2">
       <thead>
	<row>
	 <entry>Mode</entry>
	 <entry>Meaning</entry>
	</row>
       </thead>
       <tbody>
	<row>
	 <entry>0</entry>
	 <entry>Gregorian - apreviated</entry>
	</row>
	<row>
	 <entry>1</entry>
	 <entry>Gregorian</entry>
	</row>
	<row>
	 <entry>2</entry>
	 <entry>Julian - apreviated</entry>
	</row>
	<row>
	 <entry>3</entry>
	 <entry>Julian</entry>
	</row>
	<row>
	 <entry>4</entry>
	 <entry>Jewish</entry>
	</row>
	<row>
	 <entry>5</entry>
	 <entry>French Republican</entry>
	</row>
       </tbody>
      </tgroup>
     </table>

      </refsect1>
    </refentry>

    <refentry id="function.jddayofweek">
      <refnamediv>
	<refname>JDDayOfWeek</refname>
	<refpurpose>Returns the day of the week</refpurpose>
      </refnamediv>
      <refsect1>
	<title>Description</title>
	<funcsynopsis>
	  <funcdef>mixed <function>jddayofweek</function></funcdef>
	  <paramdef>int <parameter>julianday</parameter></paramdef>
	  <paramdef>int <parameter>mode</parameter></paramdef>
	</funcsynopsis>
        <para>
         Returns the day of the week.  Can return a string or an int
         depending on the mode.

     <table>
      <title>Calendar week modes</title>
      <tgroup cols="2">
       <thead>
	<row>
	 <entry>Mode</entry>
	 <entry>Meaning</entry>
	</row>
       </thead>
       <tbody>
	<row>
	 <entry>0</entry> <entry>returns the day number as an int
	 (0=sunday, 1=monday, etc)</entry>
	</row>
	<row>
	 <entry>1</entry> <entry>returns string containing the day of
	 week (english-gregorian)</entry>
	</row>
	<row>
	 <entry>2</entry> <entry>returns a string containing the
	 abreviated day of week (english-gregorian)</entry>
	</row>
       </tbody>
      </tgroup>
     </table>

      </refsect1>
    </refentry>

 </reference>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->