File: calendar.xml

package info (click to toggle)
phpdoc 20020310-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 35,272 kB
  • ctags: 354
  • sloc: xml: 799,767; php: 1,395; cpp: 500; makefile: 200; sh: 140; awk: 51
file content (511 lines) | stat: -rw-r--r-- 17,118 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
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
<?xml version="1.0" encoding="utf-8"?>
<reference id="ref.calendar">
	<title>Calendar functions</title>
	<titleabbrev>Calendar</titleabbrev>
	<partintro>
		<para>
	이 함수는 PHP 소스코드의 "dl"이나 "ext" 디렉토리에 있는 
	calender extension을 함께 사용하도록 컴파일하여야 사용가능하다. 
	사용전에 꼭 README 파일을 읽어보라. 
   </para>
		<para>
	PHP에는 서로 다른 날짜(달력) 형태를 변환시켜 주는 함수들을 제공한다. 
	Julian Day Count가 기본이 된다. 이것은 BC4000년의 어느 시점을 기준으로 잡아 
	그곳에서부터 얼마의 날짜가 지났는 가를 기준으로 삼는 것이다. 
	이 Julian Day Count는 일반적으로 사용하는 Julian 시스템과는 다르다는 것을 알아두자. 
	Calendar 시스템에 대해 자세히 알고 싶다면 <ulink url="&url.calendar;">&url.calendar;</ulink>을 방문하여 보라. 
	이 설명서중에서는 위의 페이지에서 발췌된 내용을 ""로 둘러 싸고 있다.
   </para>
	</partintro>
	<refentry id="function.jdtogregorian">
		<refnamediv>
			<refname>JDToGregorian</refname>
			<refpurpose>Converts Julian Day Count to Gregorian date</refpurpose>
		</refnamediv>
		<refsect1>
			<title>Description</title>
				<methodsynopsis>
					<type>string</type><methodname>jdtogregorian</methodname>
					<methodparam><type>int</type><parameter>julianday</parameter></methodparam>
				</methodsynopsis>
			<para>
     Converts Julian Day Count to a string containing the Gregorian
     date in the format of "month/day/year".
    </para>
		</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>
				<methodsynopsis>
					<type>int</type><methodname>gregoriantojd</methodname>
					<methodparam><type>int</type><parameter>month</parameter></methodparam>
					<methodparam><type>int</type><parameter>day</parameter></methodparam>
					<methodparam><type>int</type><parameter>year</parameter></methodparam>
				</methodsynopsis>
			<para>
     Valid Range for Gregorian Calendar 4714 B.C. to 9999 A.D.</para>
			<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>
			</para>
		</refsect1>
	</refentry>
	<refentry id="function.jdtojulian">
		<refnamediv>
			<refname>JDToJulian</refname>
			<refpurpose>
     Converts a Julian Day Count to a Julian Calendar Date
    </refpurpose>
		</refnamediv>
		<refsect1>
			<title>Description</title>
				<methodsynopsis>
					<type>string</type><methodname>jdtojulian</methodname>
					<methodparam><type>int</type><parameter>julianday</parameter></methodparam>
				</methodsynopsis>
			<para>
     Converts Julian Day Count to a string containing the Julian
     Calendar Date in the format of "month/day/year".
    </para>
		</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>
				<methodsynopsis>
					<type>int</type><methodname>juliantojd</methodname>
					<methodparam><type>int</type><parameter>month</parameter></methodparam>
					<methodparam><type>int</type><parameter>day</parameter></methodparam>
					<methodparam><type>int</type><parameter>year</parameter></methodparam>
				</methodsynopsis>
			<para>
     Valid Range for Julian Calendar 4713 B.C. to 9999 A.D.
    </para>
			<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.
    </para>
		</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>
				<methodsynopsis>
					<type>string</type><methodname>jdtojewish</methodname>
					<methodparam><type>int</type><parameter>julianday</parameter></methodparam>
				</methodsynopsis>
			<para>
     Converts a Julian Day Count the the Jewish Calendar.
    </para>
		</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>
				<methodsynopsis>
					<type>int</type><methodname>jewishtojd</methodname>
					<methodparam><type>int</type><parameter>month</parameter></methodparam>
					<methodparam><type>int</type><parameter>day</parameter></methodparam>
					<methodparam><type>int</type><parameter>year</parameter></methodparam>
				</methodsynopsis>
			<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>
			<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.
    </para>
		</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>
				<methodsynopsis>
					<type>string</type><methodname>jdtofrench</methodname>
					<methodparam><type>int</type><parameter>juliandaycount</parameter></methodparam>
				</methodsynopsis>
			<para>
     Converts a Julian Day Count to the French Republican Calendar.
    </para>
		</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>
				<methodsynopsis>
					<type>int</type><methodname>frenchtojd</methodname>
					<methodparam><type>int</type><parameter>month</parameter></methodparam>
					<methodparam><type>int</type><parameter>day</parameter></methodparam>
					<methodparam><type>int</type><parameter>year</parameter></methodparam>
				</methodsynopsis>
			<para>
     Converts a date from the French Republican Calendar to a Julian
     Day Count.
    </para>
			<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.
    </para>
		</refsect1>
	</refentry>
	<refentry id="function.jdmonthname">
		<refnamediv>
			<refname>JDMonthName</refname>
			<refpurpose>Returns a month name</refpurpose>
		</refnamediv>
		<refsect1>
			<title>Description</title>
				<methodsynopsis>
					<type>string</type><methodname>jdmonthname</methodname>
					<methodparam><type>int</type><parameter>julianday</parameter></methodparam>
					<methodparam><type>int</type><parameter>mode</parameter></methodparam>
				</methodsynopsis>
			<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 - abbreviated</entry>
							</row>
							<row>
								<entry>1</entry>
								<entry>Gregorian</entry>
							</row>
							<row>
								<entry>2</entry>
								<entry>Julian - abbreviated</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>
			</para>
		</refsect1>
	</refentry>
	<refentry id="function.jddayofweek">
		<refnamediv>
			<refname>JDDayOfWeek</refname>
			<refpurpose>Returns the day of the week</refpurpose>
		</refnamediv>
		<refsect1>
			<title>Description</title>
				<methodsynopsis>
					<type>mixed</type><methodname>jddayofweek</methodname>
					<methodparam><type>int</type><parameter>julianday</parameter></methodparam>
					<methodparam><type>int</type><parameter>mode</parameter></methodparam>
				</methodsynopsis>
			<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 abbreviated day of week
	  (english-gregorian)
	 </entry>
							</row>
						</tbody>
					</tgroup>
				</table>
			</para>
		</refsect1>
	</refentry>
	<refentry id="function.easter-date">
		<refnamediv>
			<refname>easter_date</refname>
			<refpurpose>
     Get UNIX timestamp for midnight on Easter of a given year
    </refpurpose>
		</refnamediv>
		<refsect1>
			<title>Description</title>
				<methodsynopsis>
					<type>int</type><methodname>easter_date</methodname>
					<methodparam><type>int</type><parameter>year</parameter></methodparam>
				</methodsynopsis>
			<para>
     Returns the UNIX timestamp corresponding to midnight on Easter of
     the given year.  If no year is specified, the current year is
     assumed.
    </para>
			<para>
				<emphasis>Warning:</emphasis> This function will generate
     a warning if the year is outside of the range for UNIX
     timestamps (i.e. before 1970 or after 2037).
     <example>
					<title>
						<function>easter_date</function> example</title>
					<programlisting role="php">
echo date ("M-d-Y", easter_date(1999));        /* "Apr-04-1999" */
echo date ("M-d-Y", easter_date(2000));        /* "Apr-23-2000" */
echo date ("M-d-Y", easter_date(2001));        /* "Apr-15-2001" */
      </programlisting>
				</example>
			</para>
			<para>
     The date of Easter Day was defined by the Council of Nicaea in
     AD325 as the Sunday after the first full moon which falls on or
     after the Spring Equinox.  The Equinox is assumed to always fall
     on 21st March, so the calculation reduces to determining the date
     of the full moon and the date of the following Sunday.  The
     algorithm used here was introduced around the year 532 by
     Dionysius Exiguus.  Under the Julian Calendar (for years before
     1753) a simple 19-year cycle is used to track the phases of the
     Moon.  Under the Gregorian Calendar (for years after 1753 -
     devised by Clavius and Lilius, and introduced by Pope Gregory
     XIII in October 1582, and into Britain and its then colonies in
     September 1752) two correction factors are added to make the
     cycle more accurate.
    </para>
			<para>
     (The code is based on a C program by Simon Kershaw,
     &lt;webmaster@ely.anglican.org&gt;)
    </para>
			<para>
     See <function>easter_days</function> for calculating Easter
     before 1970 or after 2037.
    </para>
		</refsect1>
	</refentry>
	<refentry id="function.easter-days">
		<refnamediv>
			<refname>easter_days</refname>
			<refpurpose>
     Get number of days after March 21 on which Easter falls for a
     given year
    </refpurpose>
		</refnamediv>
		<refsect1>
			<title>Description</title>
				<methodsynopsis>
					<type>int</type><methodname>easter_days</methodname>
					<methodparam><type>int</type><parameter>year</parameter></methodparam>
				</methodsynopsis>
			<para>
     Returns the number of days after March 21 on which Easter falls
     for a given year.  If no year is specified, the current year is
     assumed.
    </para>
			<para>
     This function can be used instead of
     <function>easter_date</function> to calculate Easter for years
     which fall outside the range of UNIX timestamps (i.e. before 1970
     or after 2037).
     <example>
					<title>
						<function>easter_date</function> example</title>
					<programlisting role="php">
echo easter_days (1999);        /* 14, i.e. April 4   */
echo easter_days (1492);        /* 32, i.e. April 22  */
echo easter_days (1913);        /*  2, i.e. March 23  */
      </programlisting>
				</example>
			</para>
			<para>
     The date of Easter Day was defined by the Council of Nicaea in
     AD325 as the Sunday after the first full moon which falls on or
     after the Spring Equinox.  The Equinox is assumed to always fall
     on 21st March, so the calculation reduces to determining the date
     of the full moon and the date of the following Sunday.  The
     algorithm used here was introduced around the year 532 by
     Dionysius Exiguus.  Under the Julian Calendar (for years before
     1753) a simple 19-year cycle is used to track the phases of the
     Moon.  Under the Gregorian Calendar (for years after 1753 -
     devised by Clavius and Lilius, and introduced by Pope Gregory
     XIII in October 1582, and into Britain and its then colonies in
     September 1752) two correction factors are added to make the
     cycle more accurate.
    </para>
			<para>
     (The code is based on a C program by Simon Kershaw,
     &lt;webmaster@ely.anglican.org&gt;)
    </para>
			<para>
     See also <function>easter_date</function>.
    </para>
		</refsect1>
	</refentry>
	<refentry id="function.unixtojd">
		<refnamediv>
			<refname>unixtojd</refname>
			<refpurpose>Convert UNIX timestamp to Julian Day</refpurpose>
		</refnamediv>
		<refsect1>
			<title>Description</title>
				<methodsynopsis>
					<type>int</type><methodname>unixtojd</methodname>
					<methodparam choice="opt"><type>int</type><parameter>
							timestamp
						</parameter></methodparam>
				</methodsynopsis>
			<para>
     Return the Julian Day for a UNIX <parameter>timestamp</parameter>
     (seconds since 1.1.1970), or for the current day if no
     <parameter>timestamp</parameter> is given.
    </para>
			<para>
     See also <function>jdtounix</function>.
    </para>
			<note>
				<para>
      This function is only available in PHP versions after PHP4RC1.
     </para>
			</note>
		</refsect1>
	</refentry>
	<refentry id="function.jdtounix">
		<refnamediv>
			<refname>jdtounix</refname>
			<refpurpose>Convert Julian Day to UNIX timestamp</refpurpose>
		</refnamediv>
		<refsect1>
			<title>Description</title>
				<methodsynopsis>
					<type>int</type><methodname>jdtounix</methodname>
					<methodparam><type>int</type><parameter>jday</parameter></methodparam>
				</methodsynopsis>
			<para>
     This function will return a UNIX timestamp corresponding to the
     Julian Day given in <parameter>jday</parameter> or &false; if
     <parameter>jday</parameter> is not inside the UNIX epoch
     (Gregorian years between 1970 and 2037 or 2440588 &lt;=
     <parameter>jday</parameter> &lt;= 2465342 )
    </para>
			<para>
     See also <function>jdtounix</function>.
    </para>
			<note>
				<para>
      This function is only available in PHP versions after PHP4RC1.
     </para>
			</note>
		</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
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->