3 <
script type=
"text/javascript" src=
"../../../build/yahoo/yahoo-min.js" ></
script>
4 <
script type=
"text/javascript" src=
"../../../build/event/event-min.js" ></
script>
5 <
script type=
"text/javascript" src=
"../../../build/datasource/datasource.js" ></
script>
6 <
script type=
"text/javascript">
7 YAHOO.util.DateLocale[
'fr'] = YAHOO.lang.merge(YAHOO.util.DateLocale, {
8 a: [
'dim',
'lun',
'mar',
'mer',
'jeu',
'ven',
'sam'],
9 A: [
'dimanche',
'lundi',
'mardi',
'mercredi',
'jeudi',
'vendredi',
'samedi'],
10 b: [
'jan',
'fév',
'mar',
'avr',
'mai',
'jun',
'jui',
'aoû',
'sep',
'oct',
'nov',
'déc'],
11 B: [
'janvier',
'février',
'mars',
'avril',
'mai',
'juin',
'juillet',
'août',
'septembre',
'octobre',
'novembre',
'décembre'],
17 YAHOO.util.DateLocale[
'fr-CA'] = YAHOO.lang.merge(YAHOO.util.DateLocale[
'fr'], { x:
'%Y-%m-%d' });
19 YAHOO.util.DateLocale[
'fr-CH'] = YAHOO.lang.merge(YAHOO.util.DateLocale[
'fr'], { x:
'%d. %m. %y' });
21 YAHOO.util.DateLocale[
'de'] = YAHOO.lang.merge(YAHOO.util.DateLocale[
'fr'], {
22 a: [
'So',
'Mo',
'Di',
'Mi',
'Do',
'Fr',
'Sa'],
23 A: [
'Sonntag',
'Montag',
'Dienstag',
'Mittwoch',
'Donnerstag',
'Freitag',
'Samstag'],
24 b: [
'Jan',
'Feb',
'Mär',
'Apr',
'Mai',
'Jun',
'Jul',
'Aug',
'Sep',
'Okt',
'Nov',
'Dez'],
25 B: [
'Januar',
'Februar',
'März',
'April',
'Mai',
'Juni',
'Juli',
'August',
'September',
'Oktober',
'November',
'Dezember']
28 YAHOO.util.DateLocale[
'de-CH'] = YAHOO.lang.merge(YAHOO.util.DateLocale[
'de'], {
29 a: [
'Son',
'Mon',
'Die',
'Mit',
'Don',
'Fre',
'Sam'],
33 YAHOO.util.DateLocale[
'hi'] = YAHOO.lang.merge(YAHOO.util.DateLocale, {
34 "a": [
"\u0930\u0935\u093f ",
"\u0938\u094b\u092e ",
"\u092e\u0902\u0917\u0932 ",
"\u092c\u0941\u0927 ",
"\u0917\u0941\u0930\u0941 ",
"\u0936\u0941\u0915\u094d\u0930 ",
"\u0936\u0928\u093f "],
35 "A": [
"\u0930\u0935\u093f\u0935\u093e\u0930 ",
"\u0938\u094b\u092e\u0935\u093e\u0930 ",
"\u092e\u0902\u0917\u0932\u0935\u093e\u0930 ",
"\u092c\u0941\u0927\u0935\u093e\u0930 ",
"\u0917\u0941\u0930\u0941\u0935\u093e\u0930 ",
"\u0936\u0941\u0915\u094d\u0930\u0935\u093e\u0930 ",
"\u0936\u0928\u093f\u0935\u093e\u0930 "],
36 "b": [
"\u091c\u0928\u0935\u0930\u0940",
"\u092b\u093c\u0930\u0935\u0930\u0940",
"\u092e\u093e\u0930\u094d\u091a",
"\u0905\u092a\u094d\u0930\u0947\u0932",
"\u092e\u0908",
"\u091c\u0942\u0928",
"\u091c\u0941\u0932\u093e\u0908",
"\u0905\u0917\u0938\u094d\u0924",
"\u0938\u093f\u0924\u092e\u094d\u092c\u0930",
"\u0905\u0915\u094d\u091f\u0942\u092c\u0930",
"\u0928\u0935\u092e\u094d\u092c\u0930",
"\u0926\u093f\u0938\u092e\u094d\u092c\u0930"],
37 "B":[
"\u091c\u0928\u0935\u0930\u0940",
"\u092b\u093c\u0930\u0935\u0930\u0940",
"\u092e\u093e\u0930\u094d\u091a",
"\u0905\u092a\u094d\u0930\u0947\u0932",
"\u092e\u0908",
"\u091c\u0942\u0928",
"\u091c\u0941\u0932\u093e\u0908",
"\u0905\u0917\u0938\u094d\u0924",
"\u0938\u093f\u0924\u092e\u094d\u092c\u0930",
"\u0905\u0915\u094d\u091f\u0942\u092c\u0930",
"\u0928\u0935\u092e\u094d\u092c\u0930",
"\u0926\u093f\u0938\u092e\u094d\u092c\u0930"],
38 "c":
"%A %d %B %Y %r",
39 "p": [
"\u092a\u0942\u0930\u094d\u0935\u093e\u0939\u094d\u0928",
"\u0905\u092a\u0930\u093e\u0939\u094d\u0928"],
40 "P": [
"\u092a\u0942\u0930\u094d\u0935\u093e\u0939\u094d\u0928",
"\u0905\u092a\u0930\u093e\u0939\u094d\u0928"],
46 YAHOO.util.DateLocale[
'ko-KR'] = YAHOO.lang.merge(YAHOO.util.DateLocale, {
47 "a": [
"\uc77c",
"\uc6d4",
"\ud654",
"\uc218",
"\ubaa9",
"\uae08",
"\ud1a0"],
48 "A": [
"\uc77c\uc694\uc77c",
"\uc6d4\uc694\uc77c",
"\ud654\uc694\uc77c",
"\uc218\uc694\uc77c",
"\ubaa9\uc694\uc77c",
"\uae08\uc694\uc77c",
"\ud1a0\uc694\uc77c"],
49 "b": [
" 1\uc6d4",
" 2\uc6d4",
" 3\uc6d4",
" 4\uc6d4",
" 5\uc6d4",
" 6\uc6d4",
" 7\uc6d4",
" 8\uc6d4",
" 9\uc6d4",
"10\uc6d4",
"11\uc6d4",
"12\uc6d4"],
50 "B": [
"1\uc6d4",
"2\uc6d4",
"3\uc6d4",
"4\uc6d4",
"5\uc6d4",
"6\uc6d4",
"7\uc6d4",
"8\uc6d4",
"9\uc6d4",
"10\uc6d4",
"11\uc6d4",
"12\uc6d4"],
52 "p": [
"\uc624\uc804",
"\uc624\ud6c4"],
53 "P": [
"\uc624\uc804",
"\uc624\ud6c4"],
54 "r":
"%p %I\uc2dc %M\ubd84 %S\ucd08",
55 "x":
"%Y\ub144 %m\uc6d4 %d\uc77c",
56 "X":
"%H\uc2dc %M\ubd84 %S\ucd08" 60 <
style type=
"text/css">
61 TH, TD { font-
size: 0.8em; }
62 .nomatch { background-
color: #f88; #
color: #fff; }
63 .match { background-
color: #8f8; #
color: #000; }
64 TH { text-align:
left; }
69 $testdates = array(time(), strtotime(
'1900/01/01'), strtotime(
'2008/01/01'), strtotime(
'2008/01/01 08:00:00'), strtotime(
'2007/12/31 23:59:59'), strtotime(
'2008/02/29'), strtotime(
'2000/12/31'));
77 $formats = array(
'a',
'A',
'b',
'B',
'c',
'C',
'd',
'D',
'e',
'F',
'g',
'G',
'h',
'H',
'I',
'j',
'k',
'l',
'm',
'M',
'n',
'p',
'P',
'r',
'R',
's',
'S',
't',
'T',
'u',
'U',
'V',
'w',
'W',
'x',
'X',
'y',
'Y',
'z',
'Z',
'%');
82 <
script type=
"text/javascript">
83 var date =
new Date(
'<?php echo strftime('%Y/%m/%d %H:%M:%S
', $date); ?>');
85 <h2>Testing: <?
php echo strftime(
'%Y/%m/%d %H:%M:%S', $date) ?> (
86 <
script type=
"text/javascript">
87 document.write(YAHOO.util.Date.format(date, {format:
'%Y/%m/%d %H:%M:%S'}));
90 <table cellspacing=0 cellpadding=4 border=1>
91 <tr> <th rowspan=
"2">format</th> <th colspan="2">US English</th> <th colspan="2">UK English</th> <th colspan="2">French</th> <th colspan="2">Canadian French</th> <th colspan="2">Swiss French</th> <th colspan="2">German</th> <th colspan="2">Swiss German</th> <th colspan="2">Hindi</th> <th colspan="2">Hangul</th> </tr>
92 <tr> <th>PHP</th> <th>Javascript</th> <th>PHP</th> <th>Javascript</th> <th>PHP</th> <th>Javascript</th> <th>PHP</th> <th>Javascript</th> <th>PHP</th> <th>Javascript</th> <th>PHP</th> <th>Javascript</th> <th>PHP</th> <th>Javascript</th> <th>PHP</th> <th>Javascript</th> <th>PHP</th> <th>Javascript</th> </tr>
98 setlocale(LC_TIME,
'en_US.UTF-8',
'en_US');
99 $sDate = strftime($format, $date);
100 $jsDate = preg_replace(
'/\n/',
'\n', $sDate);
111 <
script type=
"text/javascript">
112 var sDate=YAHOO.util.Date.format(date, {format:
"<?php echo $format ?>"},
"en-US");
113 document.write(
"<td class='" + (sDate ==
"<?php echo $jsDate ?>"?
"match":
"nomatch") +
"'>");
114 document.write(sDate);
115 document.write(
"</td>\n");
120 setlocale(LC_TIME,
'en_GB.UTF-8',
'en_GB');
121 $sDate = strftime($format, $date);
122 $jsDate = preg_replace(
'/\n/',
'\n', $sDate);
127 <
script type=
"text/javascript">
128 var sDate=YAHOO.util.Date.format(date, {format:
"<?php echo $format ?>"},
"en-GB");
129 document.write(
"<td class='" + (sDate ==
"<?php echo $jsDate ?>"?
"match":
"nomatch") +
"'>");
130 document.write(sDate);
131 document.write(
"</td>\n");
136 setlocale(LC_TIME,
'fr_FR.UTF-8',
'fr_FR',
'fr');
137 $sDate = strftime($format, $date);
138 $jsDate = preg_replace(
'/\n/',
'\n', $sDate);
144 <
script type=
"text/javascript">
145 var sDate=YAHOO.util.Date.format(date, {format:
"<?php echo $format ?>"},
"fr");
146 document.write(
"<td class='" + (sDate ==
"<?php echo $jsDate ?>"?
"match":
"nomatch") +
"'>");
147 document.write(sDate);
148 document.write(
"</td>\n");
153 setlocale(LC_TIME,
'fr_CA.UTF-8',
'fr_CA');
154 $sDate = strftime($format, $date);
155 $jsDate = preg_replace(
'/\n/',
'\n', $sDate);
161 <
script type=
"text/javascript">
162 var sDate=YAHOO.util.Date.format(date, {format:
"<?php echo $format ?>"},
"fr-CA");
163 document.write(
"<td class='" + (sDate ==
"<?php echo $jsDate ?>"?
"match":
"nomatch") +
"'>");
164 document.write(sDate);
165 document.write(
"</td>\n");
170 setlocale(LC_TIME,
'fr_CH.UTF-8',
'fr_CH');
171 $sDate = strftime($format, $date);
172 $jsDate = preg_replace(
'/\n/',
'\n', $sDate);
178 <
script type=
"text/javascript">
179 var sDate=YAHOO.util.Date.format(date, {format:
"<?php echo $format ?>"},
"fr-CH");
180 document.write(
"<td class='" + (sDate ==
"<?php echo $jsDate ?>"?
"match":
"nomatch") +
"'>");
181 document.write(sDate);
182 document.write(
"</td>\n");
187 setlocale(LC_TIME,
'de_DE.UTF-8',
'de_DE',
'de');
188 $sDate = strftime($format, $date);
189 $jsDate = preg_replace(
'/\n/',
'\n', $sDate);
195 <
script type=
"text/javascript">
196 var sDate=YAHOO.util.Date.format(date, {format:
"<?php echo $format ?>"},
"de-DE");
197 document.write(
"<td class='" + (sDate ==
"<?php echo $jsDate ?>"?
"match":
"nomatch") +
"'>");
198 document.write(sDate);
199 document.write(
"</td>\n");
204 setlocale(LC_TIME,
'de_CH.UTF-8',
'de_CH');
205 $sDate = strftime($format, $date);
206 $jsDate = preg_replace(
'/\n/',
'\n', $sDate);
212 <
script type=
"text/javascript">
213 var sDate=YAHOO.util.Date.format(date, {format:
"<?php echo $format ?>"},
"de-CH");
214 document.write(
"<td class='" + (sDate ==
"<?php echo $jsDate ?>"?
"match":
"nomatch") +
"'>");
215 document.write(sDate);
216 document.write(
"</td>\n");
221 setlocale(LC_TIME,
'hi_IN.UTF-8',
'hi_IN');
222 $sDate = strftime($format, $date);
223 $jsDate = preg_replace(
'/\n/',
'\n', $sDate);
229 <
script type=
"text/javascript">
230 var sDate=YAHOO.util.Date.format(date, {format:
"<?php echo $format ?>"},
"hi-IN");
231 document.write(
"<td class='" + (sDate ==
"<?php echo $jsDate ?>"?
"match":
"nomatch") +
"'>");
232 document.write(sDate);
233 document.write(
"</td>\n");
238 setlocale(LC_TIME,
'ko_KR.UTF-8',
'ko_KR');
239 $sDate = strftime($format, $date);
240 $jsDate = preg_replace(
'/\n/',
'\n', $sDate);
246 <
script type=
"text/javascript">
247 var sDate=YAHOO.util.Date.format(date, {format:
"<?php echo $format ?>"},
"ko-KR");
248 document.write(
"<td class='" + (sDate ==
"<?php echo $jsDate ?>"?
"match":
"nomatch") +
"'>");
249 document.write(sDate);
250 document.write(
"</td>\n");
266 setlocale(LC_TIME,
'ko_KR.UTF-8',
'ko_KR');
272 "c" =>
"%Y %m %d (%a) %r",
275 "r" =>
"%p %I %M %S %p %Z",
279 $lc[
'c'] = strftime(
"%c");
280 $lc[
'r'] = strftime(
"%r");
281 $lc[
'x'] = strftime(
"%X");
282 $lc[
'X'] = strftime(
"%X");
285 $d = strtotime(
"2008/01/$i");
286 $lc[
'a'][] = strftime(
"%a",
$d);
287 $lc[
'A'][] = strftime(
"%A",
$d);
291 $d = strtotime(
"2008/$i/1");
292 $lc[
'b'][] = strftime(
"%b",
$d);
293 $lc[
'B'][] = strftime(
"%B",
$d);
296 $d = strtotime(
"2008/01/01 10:00:00");
299 $d = strtotime(
"2008/01/01 22:00:00");
303 echo "<!-- " . json_encode(
$lc) .
" -->";
if(PHP_SAPI !='cli') color
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d