Zend_Date-Constants.xml 77 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <!-- EN-Revision: 19162 -->
  4. <sect1 id="zend.date.constants">
  5. <title>日付関数全般用の定数</title>
  6. <para>
  7. <classname>Zend_Date</classname> のメソッドでパラメータ <varname>$parts</varname>
  8. を持つものはすべて、以下の定数のいずれかをパラメータとして指定できます。
  9. これにより、日付の中の特定の要素や使用する書式
  10. (例: <acronym>RFC</acronym> 822) を指定します。
  11. </para>
  12. <sect2 id="zend.date.constants.using">
  13. <title>定数の使用</title>
  14. <para>
  15. たとえば、定数<constant>Zend_Date::HOUR</constant> の使用法は次のようになります。
  16. 曜日・時・分・秒・その他の要素が世界各地でさまざまな形式で表されていたとしても、
  17. オブジェクトのタイムゾーン設定を使用して自動的に正しい値で計算を行います。
  18. これは、内部のタイムスタンプの値が何であるかや
  19. ユーザが世界中のどこにいるかとは関係がありません。
  20. 使用する単位にかかわらず、出力結果は <acronym>GMT</acronym> あるいは <acronym>UTC</acronym>
  21. あるいはロケールにあわせて地域化された形式となります。
  22. 以下の出力サンプルは、
  23. Europe/GMT+1 (ドイツ、オーストリア、フランスなど)
  24. にあわせて地域化された形式です。
  25. </para>
  26. <table id="zend.date.constants.using.table">
  27. <title>Zend_Date::HOUR を使用した操作</title>
  28. <tgroup cols="4">
  29. <thead>
  30. <row>
  31. <entry>メソッド</entry>
  32. <entry>説明</entry>
  33. <entry>元の日付</entry>
  34. <entry>結果</entry>
  35. </row>
  36. </thead>
  37. <tbody>
  38. <row>
  39. <entry><methodname>get(Zend_Date::HOUR)</methodname></entry>
  40. <entry>時間を出力する</entry>
  41. <entry>2009-02-13T14:53:27+01:00</entry>
  42. <entry>14</entry>
  43. </row>
  44. <row>
  45. <entry><methodname>set(12, Zend_Date::HOUR)</methodname></entry>
  46. <entry>新しい時間を設定する</entry>
  47. <entry>2009-02-13T14:53:27+01:00</entry>
  48. <entry>2009-02-13T12:53:27+01:00</entry>
  49. </row>
  50. <row>
  51. <entry><methodname>add(12, Zend_Date::HOUR)</methodname></entry>
  52. <entry>時間を足す</entry>
  53. <entry>2009-02-13T14:53:27+01:00</entry>
  54. <entry>2009-02-14T02:53:27+01:00</entry>
  55. </row>
  56. <row>
  57. <entry><methodname>sub(12, Zend_Date::HOUR)</methodname></entry>
  58. <entry>時間を引く</entry>
  59. <entry>2009-02-13T14:53:27+01:00</entry>
  60. <entry>2009-02-13T02:53:27+01:00</entry>
  61. </row>
  62. <row>
  63. <entry><methodname>compare(12, Zend_Date::HOUR)</methodname></entry>
  64. <entry>時間を比較し、0 か 1 あるいは -1 を返す</entry>
  65. <entry>2009-02-13T14:53:27+01:00</entry>
  66. <entry>1 (オブジェクト > 引数 の場合)</entry>
  67. </row>
  68. <row>
  69. <entry><methodname>copy(Zend_Date::HOUR)</methodname></entry>
  70. <entry>時間部のみをコピーする</entry>
  71. <entry>2009-02-13T14:53:27+01:00</entry>
  72. <entry>1970-01-01T14:00:00+01:00</entry>
  73. </row>
  74. <row>
  75. <entry><methodname>equals(14, Zend_Date::HOUR)</methodname></entry>
  76. <entry>時間を比較し、<constant>TRUE</constant> あるいは <constant>FALSE</constant> を返す</entry>
  77. <entry>2009-02-13T14:53:27+01:00</entry>
  78. <entry><constant>TRUE</constant></entry>
  79. </row>
  80. <row>
  81. <entry><methodname>isEarlier(12, Zend_Date::HOUR)</methodname></entry>
  82. <entry>時間を比較し、<constant>TRUE</constant> あるいは <constant>FALSE</constant> を返す</entry>
  83. <entry>2009-02-13T14:53:27+01:00</entry>
  84. <entry><constant>TRUE</constant></entry>
  85. </row>
  86. <row>
  87. <entry><methodname>isLater(12, Zend_Date::HOUR)</methodname></entry>
  88. <entry>時間を比較し、<constant>TRUE</constant> あるいは <constant>FALSE</constant> を返す</entry>
  89. <entry>2009-02-13T14:53:27+01:00</entry>
  90. <entry><constant>FALSE</constant></entry>
  91. </row>
  92. </tbody>
  93. </tgroup>
  94. </table>
  95. </sect2>
  96. <sect2 id="zend.date.constants.list">
  97. <title>全定数の一覧</title>
  98. <para>
  99. 日付/時刻の各要素に対応する定数が <classname>Zend_Date</classname> で定義されています。
  100. <classname>Zend_Date</classname> がサポートするすべての定数を以下に示します。
  101. </para>
  102. <table id="zend.date.constants.list.table-1">
  103. <title>日に関する定数</title>
  104. <tgroup cols="4">
  105. <thead>
  106. <row>
  107. <entry>定数</entry>
  108. <entry>説明</entry>
  109. <entry>日付</entry>
  110. <entry>結果</entry>
  111. </row>
  112. </thead>
  113. <tbody>
  114. <row>
  115. <entry><constant>Zend_Date::DAY</constant></entry>
  116. <entry>日 (二桁の数値)</entry>
  117. <entry>2009-02-13T14:53:27+01:00</entry>
  118. <entry>
  119. <emphasis>13</emphasis>
  120. </entry>
  121. </row>
  122. <row>
  123. <entry><constant>Zend_Date::DAY_SHORT</constant></entry>
  124. <entry>日 (一桁あるいは二桁の数値)</entry>
  125. <entry>2009-02-13T14:53:27+01:00</entry>
  126. <entry>
  127. <emphasis>6</emphasis>
  128. </entry>
  129. </row>
  130. <row>
  131. <entry><constant>Zend_Date::WEEKDAY</constant></entry>
  132. <entry>曜日 (地域化された完全な曜日名)</entry>
  133. <entry>2009-02-13T14:53:27+01:00</entry>
  134. <entry><emphasis>Friday</emphasis>
  135. </entry>
  136. </row>
  137. <row>
  138. <entry><constant>Zend_Date::WEEKDAY_SHORT</constant></entry>
  139. <entry>曜日 (地域化された曜日名の短縮形。三文字)</entry>
  140. <entry>2009-02-13T14:53:27+01:00</entry>
  141. <entry><emphasis>Fri</emphasis> が金曜日を表す</entry>
  142. </row>
  143. <row>
  144. <entry><constant>Zend_Date::WEEKDAY_NAME</constant></entry>
  145. <entry>曜日 (地域化された曜日名の短縮形。二文字)</entry>
  146. <entry>2009-02-13T14:53:27+01:00</entry>
  147. <entry><emphasis>Fr</emphasis> が金曜日を表す</entry>
  148. </row>
  149. <row>
  150. <entry><constant>Zend_Date::WEEKDAY_NARROW</constant></entry>
  151. <entry>曜日 (地域化された曜日名の短縮形。一文字)</entry>
  152. <entry>2009-02-13T14:53:27+01:00</entry>
  153. <entry><emphasis>F</emphasis> が金曜日を表す</entry>
  154. </row>
  155. <row>
  156. <entry><constant>Zend_Date::WEEKDAY_DIGIT</constant></entry>
  157. <entry>曜日 (0 = 日曜日, 6 = 土曜日)</entry>
  158. <entry>2009-02-13T14:53:27+01:00</entry>
  159. <entry><emphasis>5</emphasis> が金曜日を表す</entry>
  160. </row>
  161. <row>
  162. <entry><constant>Zend_Date::WEEKDAY_8601</constant></entry>
  163. <entry><acronym>ISO</acronym> 8601 にもとづく曜日 (1 = 月曜日, 7 = 日曜日)</entry>
  164. <entry>2009-02-13T14:53:27+01:00</entry>
  165. <entry><emphasis>5</emphasis> が金曜日を表す</entry>
  166. </row>
  167. <row>
  168. <entry><constant>Zend_Date::DAY_OF_YEAR</constant></entry>
  169. <entry>日数 (一桁あるいは二桁の数値)</entry>
  170. <entry>2009-02-13T14:53:27+01:00</entry>
  171. <entry><emphasis>43</emphasis>
  172. </entry>
  173. </row>
  174. <row>
  175. <entry><constant>Zend_Date::DAY_SUFFIX</constant></entry>
  176. <entry>英語で日付の後に追加する文字 (st, nd, rd, th)</entry>
  177. <entry>2009-02-13T14:53:27+01:00</entry>
  178. <entry><emphasis>th</emphasis>
  179. </entry>
  180. </row>
  181. </tbody>
  182. </tgroup>
  183. </table>
  184. <table id="zend.date.constants.list.table-2">
  185. <title>週に関する定数</title>
  186. <tgroup cols="4">
  187. <thead>
  188. <row>
  189. <entry>定数</entry>
  190. <entry>説明</entry>
  191. <entry>日付</entry>
  192. <entry>結果</entry>
  193. </row>
  194. </thead>
  195. <tbody>
  196. <row>
  197. <entry><constant>Zend_Date::WEEK</constant></entry>
  198. <entry>週 (1 から 53 までの数値)</entry>
  199. <entry>2009-02-13T14:53:27+01:00</entry>
  200. <entry><emphasis>7</emphasis>
  201. </entry>
  202. </row>
  203. </tbody>
  204. </tgroup>
  205. </table>
  206. <table id="zend.date.constants.list.table-3">
  207. <title>月に関する定数</title>
  208. <tgroup cols="4">
  209. <thead>
  210. <row>
  211. <entry>定数</entry>
  212. <entry>説明</entry>
  213. <entry>日付</entry>
  214. <entry>結果</entry>
  215. </row>
  216. </thead>
  217. <tbody>
  218. <row>
  219. <entry><constant>Zend_Date::MONTH_NAME</constant></entry>
  220. <entry>月 (地域化された完全な月名)</entry>
  221. <entry>2009-02-13T14:53:27+01:00</entry>
  222. <entry><emphasis>February</emphasis>
  223. </entry>
  224. </row>
  225. <row>
  226. <entry><constant>Zend_Date::MONTH_NAME_SHORT</constant></entry>
  227. <entry>月 (地域化された月名の短縮形。三文字)</entry>
  228. <entry>2009-02-13T14:53:27+01:00</entry>
  229. <entry><emphasis>Feb</emphasis>
  230. </entry>
  231. </row>
  232. <row>
  233. <entry><constant>Zend_Date::MONTH_NAME_NARROW</constant></entry>
  234. <entry>月 (地域化された月名の短縮形。一文字)</entry>
  235. <entry>2009-02-13T14:53:27+01:00</entry>
  236. <entry><emphasis>F</emphasis>
  237. </entry>
  238. </row>
  239. <row>
  240. <entry><constant>Zend_Date::MONTH</constant></entry>
  241. <entry>月 (二桁の月番号)</entry>
  242. <entry>2009-02-13T14:53:27+01:00</entry>
  243. <entry><emphasis>02</emphasis></entry>
  244. </row>
  245. <row>
  246. <entry><constant>Zend_Date::MONTH_SHORT</constant></entry>
  247. <entry>月 (一桁あるいは二桁の月番号)</entry>
  248. <entry>2009-02-13T14:53:27+01:00</entry>
  249. <entry><emphasis>2</emphasis></entry>
  250. </row>
  251. <row>
  252. <entry><constant>Zend_Date::MONTH_DAYS</constant></entry>
  253. <entry>当月の日数 (数値)</entry>
  254. <entry>2009-02-13T14:53:27+01:00</entry>
  255. <entry><emphasis>28</emphasis>
  256. </entry>
  257. </row>
  258. </tbody>
  259. </tgroup>
  260. </table>
  261. <table id="zend.date.constants.list.table-4">
  262. <title>年に関する定数</title>
  263. <tgroup cols="4">
  264. <thead>
  265. <row>
  266. <entry>定数</entry>
  267. <entry>説明</entry>
  268. <entry>日付</entry>
  269. <entry>結果</entry>
  270. </row>
  271. </thead>
  272. <tbody>
  273. <row>
  274. <entry><constant>Zend_Date::YEAR</constant></entry>
  275. <entry>年 (数値)</entry>
  276. <entry>2009-02-13T14:53:27+01:00</entry>
  277. <entry><emphasis>2009</emphasis></entry>
  278. </row>
  279. <row>
  280. <entry><constant>Zend_Date::YEAR_8601</constant></entry>
  281. <entry><acronym>ISO</acronym> 8601 の年 (数値)</entry>
  282. <entry>2009-02-13T14:53:27+01:00</entry>
  283. <entry><emphasis>2009</emphasis>
  284. </entry>
  285. </row>
  286. <row>
  287. <entry><constant>Zend_Date::YEAR_SHORT</constant></entry>
  288. <entry>年 (二桁の数値)</entry>
  289. <entry>2009-02-13T14:53:27+01:00</entry>
  290. <entry><emphasis>09</emphasis></entry>
  291. </row>
  292. <row>
  293. <entry><constant>Zend_Date::YEAR_SHORT_8601</constant></entry>
  294. <entry><acronym>ISO</acronym> 8601 の年 (二桁の数値)</entry>
  295. <entry>2009-02-13T14:53:27+01:00</entry>
  296. <entry><emphasis>09</emphasis>
  297. </entry>
  298. </row>
  299. <row>
  300. <entry><constant>Zend_Date::LEAPYEAR</constant></entry>
  301. <entry>今年がうるう年かどうか? (<constant>TRUE</constant> あるいは <constant>FALSE</constant>)</entry>
  302. <entry>2009-02-13T14:53:27+01:00</entry>
  303. <entry><emphasis><constant>FALSE</constant></emphasis>
  304. </entry>
  305. </row>
  306. </tbody>
  307. </tgroup>
  308. </table>
  309. <table id="zend.date.constants.list.table-5">
  310. <title>時間に関する定数</title>
  311. <tgroup cols="4">
  312. <thead>
  313. <row>
  314. <entry>定数</entry>
  315. <entry>説明</entry>
  316. <entry>日付</entry>
  317. <entry>結果</entry>
  318. </row>
  319. </thead>
  320. <tbody>
  321. <row>
  322. <entry><constant>Zend_Date::HOUR</constant></entry>
  323. <entry>時 (00-23、二桁)</entry>
  324. <entry>2009-02-13T14:53:27+01:00</entry>
  325. <entry><emphasis>14</emphasis>
  326. </entry>
  327. </row>
  328. <row>
  329. <entry><constant>Zend_Date::HOUR_SHORT</constant></entry>
  330. <entry>時 (0-23、一桁あるいは二桁)</entry>
  331. <entry>2009-02-13T14:53:27+01:00</entry>
  332. <entry><emphasis>14</emphasis>
  333. </entry>
  334. </row>
  335. <row>
  336. <entry><constant>Zend_Date::HOUR_SHORT_AM</constant></entry>
  337. <entry>時 (1-12、一桁あるいは二桁)</entry>
  338. <entry>2009-02-13T14:53:27+01:00</entry>
  339. <entry><emphasis>2</emphasis>
  340. </entry>
  341. </row>
  342. <row>
  343. <entry><constant>Zend_Date::HOUR_AM</constant></entry>
  344. <entry>時 (01-12、二桁)</entry>
  345. <entry>2009-02-13T14:53:27+01:00</entry>
  346. <entry><emphasis>02</emphasis>
  347. </entry>
  348. </row>
  349. <row>
  350. <entry><constant>Zend_Date::MINUTE</constant></entry>
  351. <entry>分 (00-59、二桁)</entry>
  352. <entry>2009-02-13T14:53:27+01:00</entry>
  353. <entry><emphasis>53</emphasis></entry>
  354. </row>
  355. <row>
  356. <entry><constant>Zend_Date::MINUTE_SHORT</constant></entry>
  357. <entry>分 (0-59、一桁あるいは二桁)</entry>
  358. <entry>2009-02-13T14:03:27+01:00</entry>
  359. <entry><emphasis>3</emphasis></entry>
  360. </row>
  361. <row>
  362. <entry><constant>Zend_Date::SECOND</constant></entry>
  363. <entry>秒 (00-59、二桁)</entry>
  364. <entry>2009-02-13T14:53:27+01:00</entry>
  365. <entry><emphasis>27</emphasis></entry>
  366. </row>
  367. <row>
  368. <entry><constant>Zend_Date::SECOND_SHORT</constant></entry>
  369. <entry>秒 (0-59、一桁あるいは二桁)</entry>
  370. <entry>2009-02-13T14:53:07+01:00</entry>
  371. <entry><emphasis>7</emphasis></entry>
  372. </row>
  373. <row>
  374. <entry><constant>Zend_Date::MILLISECOND</constant></entry>
  375. <entry>ミリ秒 (理論上は無限大)</entry>
  376. <entry><command>2009-02-13T14:53:27.20546</command></entry>
  377. <entry><emphasis>20546</emphasis></entry>
  378. </row>
  379. <row>
  380. <entry><constant>Zend_Date::MERIDIEM</constant></entry>
  381. <entry>その日の中での時間 (午前/午後)</entry>
  382. <entry>2009-02-13T14:53:27+01:00</entry>
  383. <entry><emphasis>afternoon</emphasis>
  384. </entry>
  385. </row>
  386. <row>
  387. <entry><constant>Zend_Date::SWATCH</constant></entry>
  388. <entry>Swatch Internet Time</entry>
  389. <entry>2009-02-13T14:53:27+01:00</entry>
  390. <entry><emphasis>620</emphasis>
  391. </entry>
  392. </row>
  393. </tbody>
  394. </tgroup>
  395. </table>
  396. <table id="zend.date.constants.list.table-6">
  397. <title>タイムゾーンに関する定数</title>
  398. <tgroup cols="4">
  399. <thead>
  400. <row>
  401. <entry>定数</entry>
  402. <entry>説明</entry>
  403. <entry>日付</entry>
  404. <entry>結果</entry>
  405. </row>
  406. </thead>
  407. <tbody>
  408. <row>
  409. <entry><constant>Zend_Date::TIMEZONE</constant></entry>
  410. <entry>タイムゾーン名 (省略形文字列)</entry>
  411. <entry>2009-02-13T14:53:27+01:00</entry>
  412. <entry><emphasis><acronym>CET</acronym></emphasis>
  413. </entry>
  414. </row>
  415. <row>
  416. <entry><constant>Zend_Date::TIMEZONE_NAME</constant></entry>
  417. <entry>タイムゾーン名 (文字列)</entry>
  418. <entry>2009-02-13T14:53:27+01:00</entry>
  419. <entry><emphasis><command>Europe/Paris</command></emphasis>
  420. </entry>
  421. </row>
  422. <row>
  423. <entry><constant>Zend_Date::TIMEZONE_SECS</constant></entry>
  424. <entry><acronym>GMT</acronym> との時差を表す秒数 (integer)</entry>
  425. <entry>2009-02-13T14:53:27+01:00</entry>
  426. <entry><emphasis>3600</emphasis> seconds to <acronym>GMT</acronym></entry>
  427. </row>
  428. <row>
  429. <entry><constant>Zend_Date::GMT_DIFF</constant></entry>
  430. <entry><acronym>GMT</acronym> との時差を表す秒数 (文字列)</entry>
  431. <entry>2009-02-13T14:53:27+01:00</entry>
  432. <entry><emphasis>+0100</emphasis>
  433. </entry>
  434. </row>
  435. <row>
  436. <entry><constant>Zend_Date::GMT_DIFF_SEP</constant></entry>
  437. <entry><acronym>GMT</acronym> との時差を表す秒数 (文字列、分割形式)</entry>
  438. <entry>2009-02-13T14:53:27+01:00</entry>
  439. <entry><emphasis>+01:00</emphasis>
  440. </entry>
  441. </row>
  442. <row>
  443. <entry><constant>Zend_Date::DAYLIGHT</constant></entry>
  444. <entry>夏時間かそうでないか? (<constant>TRUE</constant> あるいは <constant>FALSE</constant>)</entry>
  445. <entry>2009-02-13T14:53:27+01:00</entry>
  446. <entry><emphasis><constant>FALSE</constant></emphasis>
  447. </entry>
  448. </row>
  449. </tbody>
  450. </tgroup>
  451. </table>
  452. <table id="zend.date.constants.list.table-7">
  453. <title>日付フォーマットに関する定数 (タイムゾーンを含むフォーマット)</title>
  454. <tgroup cols="4">
  455. <thead>
  456. <row>
  457. <entry>定数</entry>
  458. <entry>説明</entry>
  459. <entry>日付</entry>
  460. <entry>結果</entry>
  461. </row>
  462. </thead>
  463. <tbody>
  464. <row>
  465. <entry><constant>Zend_Date::ISO_860</constant>1</entry>
  466. <entry><acronym>ISO</acronym> 8601 形式の日付 (文字列)</entry>
  467. <entry>2009-02-13T14:53:27+01:00</entry>
  468. <entry><emphasis>2009-02-13T14:53:27+01:00</emphasis>
  469. </entry>
  470. </row>
  471. <row>
  472. <entry><constant>Zend_Date::RFC_2822</constant></entry>
  473. <entry><acronym>RFC</acronym> 2822 形式の日付 (文字列)</entry>
  474. <entry>2009-02-13T14:53:27+01:00</entry>
  475. <entry><emphasis>Fri, 13 Feb 2009 14:53:27 +0100</emphasis>
  476. </entry>
  477. </row>
  478. <row>
  479. <entry><constant>Zend_Date::TIMESTAMP</constant></entry>
  480. <entry>
  481. <ulink url="http://en.wikipedia.org/wiki/Unix_Time">Unix time</ulink> (1970 年 1 月 1 日からの経過秒数)</entry>
  482. <entry>2009-02-13T14:53:27+01:00</entry>
  483. <entry><emphasis>1234533207</emphasis>
  484. </entry>
  485. </row>
  486. <row>
  487. <entry><constant>Zend_Date::ATOM</constant></entry>
  488. <entry><acronym>ATOM</acronym> 形式の日付 (文字列)</entry>
  489. <entry>2009-02-13T14:53:27+01:00</entry>
  490. <entry><emphasis>2009-02-13T14:53:27+01:00</emphasis>
  491. </entry>
  492. </row>
  493. <row>
  494. <entry><constant>Zend_Date::COOKIE</constant></entry>
  495. <entry>クッキー形式の日付 (クッキー用の文字列)</entry>
  496. <entry>2009-02-13T14:53:27+01:00</entry>
  497. <entry>
  498. <emphasis><command>Friday, 13-Feb-09 14:53:27
  499. Europe/Paris</command></emphasis>
  500. </entry>
  501. </row>
  502. <row>
  503. <entry><constant>Zend_Date::RFC_822</constant></entry>
  504. <entry><acronym>RFC</acronym> 822 形式の日付 (文字列)</entry>
  505. <entry>2009-02-13T14:53:27+01:00</entry>
  506. <entry><emphasis>Fri, 13 Feb 09 14:53:27 +0100</emphasis>
  507. </entry>
  508. </row>
  509. <row>
  510. <entry><constant>Zend_Date::RFC_850</constant></entry>
  511. <entry><acronym>RFC</acronym> 850 形式の日付 (文字列)</entry>
  512. <entry>2009-02-13T14:53:27+01:00</entry>
  513. <entry>
  514. <emphasis><command>Friday, 13-Feb-09 14:53:27
  515. Europe/Paris</command></emphasis>
  516. </entry>
  517. </row>
  518. <row>
  519. <entry><constant>Zend_Date::RFC_1036</constant></entry>
  520. <entry><acronym>RFC</acronym> 1036 形式の日付 (文字列)</entry>
  521. <entry>2009-02-13T14:53:27+01:00</entry>
  522. <entry><emphasis>Fri, 13 Feb 09 14:53:27 +0100</emphasis>
  523. </entry>
  524. </row>
  525. <row>
  526. <entry><constant>Zend_Date::RFC_1123</constant></entry>
  527. <entry><acronym>RFC</acronym> 1123 形式の日付 (文字列)</entry>
  528. <entry>2009-02-13T14:53:27+01:00</entry>
  529. <entry><emphasis>Fri, 13 Feb 2009 14:53:27 +0100</emphasis>
  530. </entry>
  531. </row>
  532. <row>
  533. <entry><constant>Zend_Date::RSS</constant></entry>
  534. <entry><acronym>RSS</acronym> フィード形式の日付 (文字列)</entry>
  535. <entry>2009-02-13T14:53:27+01:00</entry>
  536. <entry><emphasis>Fri, 13 Feb 2009 14:53:27 +0100</emphasis>
  537. </entry>
  538. </row>
  539. <row>
  540. <entry><constant>Zend_Date::W3C</constant></entry>
  541. <entry>
  542. <acronym>HTML</acronym> あるいは <acronym>HTTP</acronym> 用の
  543. <acronym>W3C</acronym> 形式の日付 (文字列)
  544. </entry>
  545. <entry>2009-02-13T14:53:27+01:00</entry>
  546. <entry><emphasis>2009-02-13T14:53:27+01:00</emphasis>
  547. </entry>
  548. </row>
  549. </tbody>
  550. </tgroup>
  551. </table>
  552. <para>
  553. 特に注意すべきなのは <constant>Zend_Date::DATES</constant> です。これは、
  554. <classname>Zend_Date</classname> で <emphasis>入力</emphasis>
  555. フォーマットを指定する際に使用すると、特別な働きをします。
  556. 入力フォーマットとして <varname>$part</varname> で使用すると、
  557. この定数は、さまざまな類似日付書式をできるだけ受け入れようとします。
  558. 経験則にもとづいて入力日付文字列を自動的に分解し、単純なエラーを (もしあれば)
  559. できるだけ修正します。たとえば年、月、日の順序がおかしい場合などです。
  560. </para>
  561. <table id="zend.date.constants.list.table-8">
  562. <title>日付および時刻フォーマットに関する定数 (ロケールによって変化する書式)</title>
  563. <tgroup cols="4">
  564. <thead>
  565. <row>
  566. <entry>定数</entry>
  567. <entry>説明</entry>
  568. <entry>日付</entry>
  569. <entry>結果</entry>
  570. </row>
  571. </thead>
  572. <tbody>
  573. <row>
  574. <entry><constant>Zend_Date::ERA</constant></entry>
  575. <entry>時代 (地域化された文字列の短縮形)</entry>
  576. <entry>2009-02-13T14:53:27+01:00</entry>
  577. <entry><emphasis>AD</emphasis> (紀元後)</entry>
  578. </row>
  579. <row>
  580. <entry><constant>Zend_Date::ERA_NAME</constant></entry>
  581. <entry>時代 (地域化された文字列の完全系)</entry>
  582. <entry>2009-02-13T14:53:27+01:00</entry>
  583. <entry><emphasis>anno domini</emphasis> (紀元後)</entry>
  584. </row>
  585. <row>
  586. <entry><emphasis>Zend_Date::DATES</emphasis>
  587. </entry>
  588. <entry>標準の日付 (地域化された文字列、デフォルト値)</entry>
  589. <entry>2009-02-13T14:53:27+01:00</entry>
  590. <entry><emphasis>13.02.2009</emphasis>
  591. </entry>
  592. </row>
  593. <row>
  594. <entry><constant>Zend_Date::DATE_FULL</constant></entry>
  595. <entry>完全な日付 (地域化された文字列、完全形)</entry>
  596. <entry>2009-02-13T14:53:27+01:00</entry>
  597. <entry><emphasis>Friday, 13. February 2009</emphasis>
  598. </entry>
  599. </row>
  600. <row>
  601. <entry><constant>Zend_Date::DATE_LONG</constant></entry>
  602. <entry>長い日付 (地域化された文字列、長い形式)</entry>
  603. <entry>2009-02-13T14:53:27+01:00</entry>
  604. <entry><emphasis>13. February 2009</emphasis>
  605. </entry>
  606. </row>
  607. <row>
  608. <entry><constant>Zend_Date::DATE_MEDIUM</constant></entry>
  609. <entry>通常の日付 (地域化された文字列、通常の形式)</entry>
  610. <entry>2009-02-13T14:53:27+01:00</entry>
  611. <entry><emphasis>13.02.2009</emphasis>
  612. </entry>
  613. </row>
  614. <row>
  615. <entry><constant>Zend_Date::DATE_SHORT</constant></entry>
  616. <entry>省略形の日付 (地域化された文字列、短縮形式)</entry>
  617. <entry>2009-02-13T14:53:27+01:00</entry>
  618. <entry><emphasis>13.02.09</emphasis>
  619. </entry>
  620. </row>
  621. <row>
  622. <entry><constant>Zend_Date::TIMES</constant></entry>
  623. <entry>標準の時刻 (地域化された文字列、デフォルト値)</entry>
  624. <entry>2009-02-13T14:53:27+01:00</entry>
  625. <entry><emphasis>14:53:27</emphasis>
  626. </entry>
  627. </row>
  628. <row>
  629. <entry><constant>Zend_Date::TIME_FULL</constant></entry>
  630. <entry>完全な時刻 (地域化された文字列、完全形)</entry>
  631. <entry>2009-02-13T14:53:27+01:00</entry>
  632. <entry><emphasis>14:53 Uhr <acronym>CET</acronym></emphasis>
  633. </entry>
  634. </row>
  635. <row>
  636. <entry><constant>Zend_Date::TIME_LONG</constant></entry>
  637. <entry>長い時刻 (地域化された文字列、長い形式)</entry>
  638. <entry>2009-02-13T14:53:27+01:00</entry>
  639. <entry><emphasis>14:53:27 <acronym>CET</acronym></emphasis>
  640. </entry>
  641. </row>
  642. <row>
  643. <entry><constant>Zend_Date::TIME_MEDIUM</constant></entry>
  644. <entry>通常の時刻 (地域化された文字列、通常の形式)</entry>
  645. <entry>2009-02-13T14:53:27+01:00</entry>
  646. <entry><emphasis>14:53:27</emphasis>
  647. </entry>
  648. </row>
  649. <row>
  650. <entry><constant>Zend_Date::TIME_SHORT</constant></entry>
  651. <entry>省略形の時刻 (地域化された文字列、短縮形式)</entry>
  652. <entry>2009-02-13T14:53:27+01:00</entry>
  653. <entry><emphasis>14:53</emphasis>
  654. </entry>
  655. </row>
  656. <row>
  657. <entry><emphasis>Zend_Date::DATETIME</emphasis>
  658. </entry>
  659. <entry>標準の日付・時刻 (地域化された文字列、デフォルト値)</entry>
  660. <entry>2009-02-13T14:53:27+01:00</entry>
  661. <entry><emphasis>13.02.2009 14:53:27</emphasis>
  662. </entry>
  663. </row>
  664. <row>
  665. <entry><constant>Zend_Date::DATETIME_FULL</constant></entry>
  666. <entry>完全な日付・時刻 (地域化された文字列、完全な形式)</entry>
  667. <entry>2009-02-13T14:53:27+01:00</entry>
  668. <entry><emphasis>Friday, 13. February 2009 14:53 Uhr <acronym>CET</acronym></emphasis>
  669. </entry>
  670. </row>
  671. <row>
  672. <entry><constant>Zend_Date::DATETIME_LONG</constant></entry>
  673. <entry>長い日付・時刻 (地域化された文字列、長い形式)</entry>
  674. <entry>2009-02-13T14:53:27+01:00</entry>
  675. <entry><emphasis>13. February 2009 14:53:27 <acronym>CET</acronym></emphasis>
  676. </entry>
  677. </row>
  678. <row>
  679. <entry><constant>Zend_Date::DATETIME_MEDIUM</constant></entry>
  680. <entry>通常の日付・時刻 (地域化された文字列、通常の形式)</entry>
  681. <entry>2009-02-13T14:53:27+01:00</entry>
  682. <entry><emphasis>13.02.2009 14:53:27</emphasis>
  683. </entry>
  684. </row>
  685. <row>
  686. <entry><constant>Zend_Date::DATETIME_SHORT</constant></entry>
  687. <entry>省略形の日付・時刻 (地域化された文字列、短縮形式)</entry>
  688. <entry>2009-02-13T14:53:27+01:00</entry>
  689. <entry><emphasis>13.02.09 14:53</emphasis>
  690. </entry>
  691. </row>
  692. </tbody>
  693. </tgroup>
  694. </table>
  695. </sect2>
  696. <sect2 id="zend.date.constants.selfdefinedformats">
  697. <title>ISO 書式指定子を使用して自分で定義する出力フォーマット</title>
  698. <para>
  699. 上で示したもの意外の日付書式が必要な場合は、以下に示す
  700. <acronym>ISO</acronym> 書式トークンを使用して自分で書式を定義します。
  701. 以下の例は、下の表の定数を用いて独自の <acronym>ISO</acronym> 書式を作成する方法を示すものです。
  702. 書式の長さは無制限で、同じ定数を複数回使用してもかまいません。
  703. </para>
  704. <para>
  705. もし <acronym>PHP</acronym> 風の日付書式のほうがなじみがあるのなら、
  706. <acronym>ISO</acronym> 書式ではなく <acronym>PHP</acronym> の書式を用いるように変更することも可能です。
  707. しかし、<acronym>ISO</acronym> で定められているすべての書式が <acronym>PHP</acronym> の日付書式で指定できるわけではありません。
  708. <methodname>Zend_Date::setOptions(array('format_type' => 'php'))</methodname> メソッドを使用すると、
  709. <classname>Zend_Date</classname> のメソッドで <acronym>ISO</acronym> 書式指定子ではなく <acronym>PHP</acronym> の date() での指定子を用いるようになります
  710. (以下の <link linkend="zend.date.constants.phpformats">PHP の date() 関数の書式指定子を使用して
  711. 自分で定義する出力フォーマット</link> を参照ください)。
  712. </para>
  713. <example id="zend.date.constants.selfdefinedformats.example-1">
  714. <title>ISO 書式を使用した独自書式</title>
  715. <programlisting language="php"><![CDATA[
  716. $locale = new Zend_Locale('de_AT');
  717. $date = new Zend_Date(1234567890, false, $locale);
  718. print $date->toString("'Era:GGGG='GGGG, ' Date:yy.MMMM.dd'yy.MMMM.dd");
  719. ]]></programlisting>
  720. </example>
  721. <table id="zend.date.constants.selfdefinedformats.table">
  722. <title>ISO 8601 日付出力に関する定数</title>
  723. <tgroup cols="4">
  724. <thead>
  725. <row>
  726. <entry>定数</entry>
  727. <entry>説明</entry>
  728. <entry>対応する要素</entry>
  729. <entry>結果</entry>
  730. </row>
  731. </thead>
  732. <tbody>
  733. <row>
  734. <entry>G</entry>
  735. <entry>時代 (地域化された省略形)</entry>
  736. <entry><constant>Zend_Date::ERA</constant></entry>
  737. <entry><emphasis>AD</emphasis>
  738. </entry>
  739. </row>
  740. <row>
  741. <entry>GG</entry>
  742. <entry>時代 (地域化された省略形)</entry>
  743. <entry><constant>Zend_Date::ERA</constant></entry>
  744. <entry><emphasis>AD</emphasis>
  745. </entry>
  746. </row>
  747. <row>
  748. <entry><constant>GGG</constant></entry>
  749. <entry>時代 (地域化された省略形)</entry>
  750. <entry><constant>Zend_Date::ERA</constant></entry>
  751. <entry><emphasis>AD</emphasis>
  752. </entry>
  753. </row>
  754. <row>
  755. <entry><constant>GGGG</constant></entry>
  756. <entry>時代 (地域化された完全形)</entry>
  757. <entry><constant>Zend_Date::ERA_NAME</constant></entry>
  758. <entry><emphasis>anno domini</emphasis>
  759. </entry>
  760. </row>
  761. <row>
  762. <entry><constant>GGGGG</constant></entry>
  763. <entry>時代 (地域化された省略形)</entry>
  764. <entry><constant>Zend_Date::ERA</constant></entry>
  765. <entry><emphasis>a</emphasis>
  766. </entry>
  767. </row>
  768. <row>
  769. <entry>y</entry>
  770. <entry>年 (最低一桁)</entry>
  771. <entry><constant>Zend_Date::YEAR</constant></entry>
  772. <entry><emphasis>9</emphasis>
  773. </entry>
  774. </row>
  775. <row>
  776. <entry>yy</entry>
  777. <entry>年 (最低二桁)</entry>
  778. <entry><constant>Zend_Date::YEAR_SHORT</constant></entry>
  779. <entry><emphasis>09</emphasis>
  780. </entry>
  781. </row>
  782. <row>
  783. <entry>yyy</entry>
  784. <entry>年 (最低三桁)</entry>
  785. <entry><constant>Zend_Date::YEAR</constant></entry>
  786. <entry><emphasis>2009</emphasis>
  787. </entry>
  788. </row>
  789. <row>
  790. <entry>yyyy</entry>
  791. <entry>年 (最低四桁)</entry>
  792. <entry><constant>Zend_Date::YEAR</constant></entry>
  793. <entry><emphasis>2009</emphasis>
  794. </entry>
  795. </row>
  796. <row>
  797. <entry>yyyyy</entry>
  798. <entry>年 (最低五桁)</entry>
  799. <entry><constant>Zend_Date::YEAR</constant></entry>
  800. <entry><emphasis>02009</emphasis>
  801. </entry>
  802. </row>
  803. <row>
  804. <entry>Y</entry>
  805. <entry><acronym>ISO</acronym> 8601 形式の年 (最低一桁)</entry>
  806. <entry><constant>Zend_Date::YEAR_8601</constant></entry>
  807. <entry><emphasis>9</emphasis>
  808. </entry>
  809. </row>
  810. <row>
  811. <entry>YY</entry>
  812. <entry><acronym>ISO</acronym> 8601 形式の年 (最低二桁)</entry>
  813. <entry><constant>Zend_Date::YEAR_SHORT_8601</constant></entry>
  814. <entry><emphasis>09</emphasis>
  815. </entry>
  816. </row>
  817. <row>
  818. <entry><constant>YYY</constant></entry>
  819. <entry><acronym>ISO</acronym> 8601 形式の年 (最低三桁)</entry>
  820. <entry><constant>Zend_Date::YEAR_8601</constant></entry>
  821. <entry><emphasis>2009</emphasis>
  822. </entry>
  823. </row>
  824. <row>
  825. <entry><constant>YYYY</constant></entry>
  826. <entry><acronym>ISO</acronym> 8601 形式の年 (最低四桁)</entry>
  827. <entry><constant>Zend_Date::YEAR_8601</constant></entry>
  828. <entry><emphasis>2009</emphasis>
  829. </entry>
  830. </row>
  831. <row>
  832. <entry><constant>YYYYY</constant></entry>
  833. <entry><acronym>ISO</acronym> 8601 形式の年 (最低五桁)</entry>
  834. <entry><constant>Zend_Date::YEAR_8601</constant></entry>
  835. <entry><emphasis>02009</emphasis>
  836. </entry>
  837. </row>
  838. <row>
  839. <entry>M</entry>
  840. <entry>月 (一桁あるいは二桁)</entry>
  841. <entry><constant>Zend_Date::MONTH_SHORT</constant></entry>
  842. <entry><emphasis>2</emphasis>
  843. </entry>
  844. </row>
  845. <row>
  846. <entry>MM</entry>
  847. <entry>月 (二桁)</entry>
  848. <entry><constant>Zend_Date::MONTH</constant></entry>
  849. <entry><emphasis>02</emphasis>
  850. </entry>
  851. </row>
  852. <row>
  853. <entry><constant>MMM</constant></entry>
  854. <entry>月 (地域化された省略形)</entry>
  855. <entry><constant>Zend_Date::MONTH_NAME_SHORT</constant></entry>
  856. <entry><emphasis>Feb</emphasis>
  857. </entry>
  858. </row>
  859. <row>
  860. <entry><constant>MMMM</constant></entry>
  861. <entry>月 (地域化された完全形)</entry>
  862. <entry><constant>Zend_Date::MONTH_NAME</constant></entry>
  863. <entry><emphasis>February</emphasis>
  864. </entry>
  865. </row>
  866. <row>
  867. <entry><constant>MMMMM</constant></entry>
  868. <entry>月 (地域化された省略形、一桁)</entry>
  869. <entry><constant>Zend_Date::MONTH_NAME_NARROW</constant></entry>
  870. <entry><emphasis>F</emphasis>
  871. </entry>
  872. </row>
  873. <row>
  874. <entry>w</entry>
  875. <entry>週 (一桁あるいは二桁)</entry>
  876. <entry><constant>Zend_Date::WEEK</constant></entry>
  877. <entry><emphasis>5</emphasis>
  878. </entry>
  879. </row>
  880. <row>
  881. <entry>ww</entry>
  882. <entry>週 (二桁)</entry>
  883. <entry><constant>Zend_Date::WEEK</constant></entry>
  884. <entry><emphasis>05</emphasis>
  885. </entry>
  886. </row>
  887. <row>
  888. <entry>d</entry>
  889. <entry>その月の日付 (一桁あるいは二桁)</entry>
  890. <entry><constant>Zend_Date::DAY_SHORT</constant></entry>
  891. <entry><emphasis>9</emphasis>
  892. </entry>
  893. </row>
  894. <row>
  895. <entry>dd</entry>
  896. <entry>その月の日付 (二桁)</entry>
  897. <entry><constant>Zend_Date::DAY</constant></entry>
  898. <entry><emphasis>09</emphasis>
  899. </entry>
  900. </row>
  901. <row>
  902. <entry>D</entry>
  903. <entry>その年の日付 (一桁、二桁あるいは三桁)</entry>
  904. <entry><constant>Zend_Date::DAY_OF_YEAR</constant></entry>
  905. <entry><emphasis>7</emphasis>
  906. </entry>
  907. </row>
  908. <row>
  909. <entry>DD</entry>
  910. <entry>その年の日付 (二桁あるいは三桁)</entry>
  911. <entry><constant>Zend_Date::DAY_OF_YEAR</constant></entry>
  912. <entry><emphasis>07</emphasis>
  913. </entry>
  914. </row>
  915. <row>
  916. <entry><constant>DDD</constant></entry>
  917. <entry>その年の日付 (三桁)</entry>
  918. <entry><constant>Zend_Date::DAY_OF_YEAR</constant></entry>
  919. <entry><emphasis>007</emphasis>
  920. </entry>
  921. </row>
  922. <row>
  923. <entry>E</entry>
  924. <entry>曜日 (地域化された省略形、一文字)</entry>
  925. <entry><constant>Zend_Date::WEEKDAY_NARROW</constant></entry>
  926. <entry><emphasis>M</emphasis>
  927. </entry>
  928. </row>
  929. <row>
  930. <entry>EE</entry>
  931. <entry>曜日 (地域化された省略形、二文字以上)</entry>
  932. <entry><constant>Zend_Date::WEEKDAY_NAME</constant></entry>
  933. <entry><emphasis>Mo</emphasis>
  934. </entry>
  935. </row>
  936. <row>
  937. <entry><constant>EEE</constant></entry>
  938. <entry>曜日 (地域化された省略形、三文字)</entry>
  939. <entry><constant>Zend_Date::WEEKDAY_SHORT</constant></entry>
  940. <entry><emphasis>Mon</emphasis>
  941. </entry>
  942. </row>
  943. <row>
  944. <entry><constant>EEEE</constant></entry>
  945. <entry>曜日 (地域化された完全形)</entry>
  946. <entry><constant>Zend_Date::WEEKDAY</constant></entry>
  947. <entry><emphasis>Monday</emphasis>
  948. </entry>
  949. </row>
  950. <row>
  951. <entry><constant>EEEEE</constant></entry>
  952. <entry>曜日 (地域化された省略形、一桁)</entry>
  953. <entry><constant>Zend_Date::WEEKDAY_NARROW</constant></entry>
  954. <entry><emphasis>M</emphasis>
  955. </entry>
  956. </row>
  957. <row>
  958. <entry>e</entry>
  959. <entry>曜日番号 (一桁)</entry>
  960. <entry><constant>Zend_Date::WEEKDAY_DIGIT</constant></entry>
  961. <entry><emphasis>4</emphasis>
  962. </entry>
  963. </row>
  964. <row>
  965. <entry>ee</entry>
  966. <entry>曜日番号 (二桁)</entry>
  967. <entry><constant>Zend_Date::WEEKDAY_NARROW</constant></entry>
  968. <entry><emphasis>04</emphasis>
  969. </entry>
  970. </row>
  971. <row>
  972. <entry>a</entry>
  973. <entry>午前/午後 (地域化された形式)</entry>
  974. <entry><constant>Zend_Date::MERIDIEM</constant></entry>
  975. <entry><emphasis>vorm.</emphasis>
  976. </entry>
  977. </row>
  978. <row>
  979. <entry>h</entry>
  980. <entry>時間 (1-12) (一桁あるいは二桁)</entry>
  981. <entry><constant>Zend_Date::HOUR_SHORT_AM</constant></entry>
  982. <entry><emphasis>2</emphasis>
  983. </entry>
  984. </row>
  985. <row>
  986. <entry>hh</entry>
  987. <entry>時間 (01-12) (二桁)</entry>
  988. <entry><constant>Zend_Date::HOUR_AM</constant></entry>
  989. <entry><emphasis>02</emphasis>
  990. </entry>
  991. </row>
  992. <row>
  993. <entry>H</entry>
  994. <entry>時間 (0-23) (一桁あるいは二桁)</entry>
  995. <entry><constant>Zend_Date::HOUR_SHORT</constant></entry>
  996. <entry><emphasis>2</emphasis>
  997. </entry>
  998. </row>
  999. <row>
  1000. <entry>HH</entry>
  1001. <entry>時間 (00-23) (二桁)</entry>
  1002. <entry><constant>Zend_Date::HOUR</constant></entry>
  1003. <entry><emphasis>02</emphasis>
  1004. </entry>
  1005. </row>
  1006. <row>
  1007. <entry>m</entry>
  1008. <entry>分 (0-59) (一桁あるいは二桁)</entry>
  1009. <entry><constant>Zend_Date::MINUTE_SHORT</constant></entry>
  1010. <entry><emphasis>2</emphasis>
  1011. </entry>
  1012. </row>
  1013. <row>
  1014. <entry>mm</entry>
  1015. <entry>分 (00-59) (二桁)</entry>
  1016. <entry><constant>Zend_Date::MINUTE</constant></entry>
  1017. <entry><emphasis>02</emphasis>
  1018. </entry>
  1019. </row>
  1020. <row>
  1021. <entry>s</entry>
  1022. <entry>秒 (0-59) (一桁あるいは二桁)</entry>
  1023. <entry><constant>Zend_Date::SECOND_SHORT</constant></entry>
  1024. <entry><emphasis>2</emphasis>
  1025. </entry>
  1026. </row>
  1027. <row>
  1028. <entry>ss</entry>
  1029. <entry>秒 (00-59) (二桁)</entry>
  1030. <entry><constant>Zend_Date::SECOND</constant></entry>
  1031. <entry><emphasis>02</emphasis>
  1032. </entry>
  1033. </row>
  1034. <row>
  1035. <entry>S</entry>
  1036. <entry>ミリ秒</entry>
  1037. <entry><constant>Zend_Date::MILLISECOND</constant></entry>
  1038. <entry><emphasis>20536</emphasis>
  1039. </entry>
  1040. </row>
  1041. <row>
  1042. <entry>z</entry>
  1043. <entry>タイムゾーン (地域化された省略形)</entry>
  1044. <entry><constant>Zend_Date::TIMEZONE</constant></entry>
  1045. <entry><emphasis>CET</emphasis>
  1046. </entry>
  1047. </row>
  1048. <row>
  1049. <entry>zz</entry>
  1050. <entry>タイムゾーン (地域化された省略形)</entry>
  1051. <entry><constant>Zend_Date::TIMEZONE</constant></entry>
  1052. <entry><emphasis>CET</emphasis>
  1053. </entry>
  1054. </row>
  1055. <row>
  1056. <entry>zzz</entry>
  1057. <entry>タイムゾーン (地域化された省略形)</entry>
  1058. <entry><constant>Zend_Date::TIMEZONE</constant></entry>
  1059. <entry><emphasis>CET</emphasis>
  1060. </entry>
  1061. </row>
  1062. <row>
  1063. <entry>zzzz</entry>
  1064. <entry>タイムゾーン (地域化された完全形)</entry>
  1065. <entry><constant>Zend_Date::TIMEZONE_NAME</constant></entry>
  1066. <entry><emphasis>Europe/Paris</emphasis>
  1067. </entry>
  1068. </row>
  1069. <row>
  1070. <entry>Z</entry>
  1071. <entry>タイムゾーンの時差</entry>
  1072. <entry><constant>Zend_Date::GMT_DIFF</constant></entry>
  1073. <entry><emphasis>+0100</emphasis>
  1074. </entry>
  1075. </row>
  1076. <row>
  1077. <entry>ZZ</entry>
  1078. <entry>タイムゾーンの時差</entry>
  1079. <entry><constant>Zend_Date::GMT_DIFF</constant></entry>
  1080. <entry><emphasis>+0100</emphasis>
  1081. </entry>
  1082. </row>
  1083. <row>
  1084. <entry><constant>ZZZ</constant></entry>
  1085. <entry>タイムゾーンの時差</entry>
  1086. <entry><constant>Zend_Date::GMT_DIFF</constant></entry>
  1087. <entry><emphasis>+0100</emphasis>
  1088. </entry>
  1089. </row>
  1090. <row>
  1091. <entry><constant>ZZZZ</constant></entry>
  1092. <entry>タイムゾーンの時差 (分割形式)</entry>
  1093. <entry><constant>Zend_Date::GMT_DIFF_SEP</constant></entry>
  1094. <entry><emphasis>+01:00</emphasis>
  1095. </entry>
  1096. </row>
  1097. <row>
  1098. <entry>A</entry>
  1099. <entry>ミリ秒</entry>
  1100. <entry><constant>Zend_Date::MILLISECOND</constant></entry>
  1101. <entry><emphasis>20563</emphasis>
  1102. </entry>
  1103. </row>
  1104. </tbody>
  1105. </tgroup>
  1106. </table>
  1107. <note>
  1108. <para>
  1109. デフォルトの <acronym>ISO</acronym> フォーマットは、<acronym>PHP</acronym> のフォーマットとは異なることに注意しましょう。
  1110. これまでに使ったことがない方は、少々いらいらするかもしれません。
  1111. 特に、<emphasis>「年」と「分」</emphasis>
  1112. に関する指定子については、なかなか期待通りに動作しないことでしょう。
  1113. </para>
  1114. <para>
  1115. <emphasis>「年」</emphasis>
  1116. については、間違えやすい指定子がふたつあります。
  1117. <acronym>ISO</acronym> 形式の年を表す <emphasis>Y</emphasis> 指定子と、
  1118. 実際の年を表す <emphasis>y</emphasis> 指定子です。
  1119. 両者の違いは些細なものではありますが、非常に重要です。
  1120. <emphasis>Y</emphasis> は <acronym>ISO</acronym> 形式の年を算出するものです。
  1121. これは、カレンダーを作成する際によく用いられます。
  1122. 2007 年 12 月 31 日を例にとって考えてみましょう。
  1123. 実際の年は 2007 ですが、この日は
  1124. 2008 年の最初の週 (第 1 週) の最初の日でもあります。
  1125. したがって、'dd.MM.yyyy' として場合は '31.December.2007'
  1126. が得られますが、'dd.MM.YYYY' とした場合の結果は '31.December.2008'
  1127. となるのです。これはバグではなく、期待通りの振る舞いです。
  1128. これが、ふたつの指定子の違いとなります。
  1129. </para>
  1130. <para>
  1131. <emphasis>「分」</emphasis>
  1132. の場合は、違いはそれほど大きくはありません。<acronym>ISO</acronym> では「分」
  1133. を表す指定子として <emphasis>m</emphasis>
  1134. を使用します。<acronym>PHP</acronym> が使っている <emphasis>i</emphasis>
  1135. ではありません。分を取得する書式指定をする際には、
  1136. 正しい指定子を使っているかどうかを確認するようにしましょう。
  1137. </para>
  1138. </note>
  1139. </sect2>
  1140. <sect2 id="zend.date.constants.phpformats">
  1141. <title>PHP の date() 関数の書式指定子を使用して自分で定義する出力フォーマット</title>
  1142. <para>
  1143. もし <acronym>PHP</acronym> の日付書式指定子のほうが <acronym>ISO</acronym> 書式指定子よりなじみがあるのなら、
  1144. <methodname>Zend_Date::setOptions(array('format_type' => 'php'))</methodname> を使用しましょう。これで、
  1145. <classname>Zend_Date</classname> のメソッドで <acronym>ISO</acronym> 書式指定子ではなく <acronym>PHP</acronym> の date() での指定子を用いるようになります
  1146. その後の書式パラメータは、すべて
  1147. <ulink url="http://php.net/date"><acronym>PHP</acronym> の <methodname>date()</methodname> 書式指定子</ulink>
  1148. に従うようになります。<acronym>PHP</acronym> の日付書式には含まれていないけれども <acronym>ISO</acronym> の書式には含まれるもの、
  1149. またその逆もあります。もしそれほど <acronym>PHP</acronym> の日付書式になじみがないのなら、標準の
  1150. <acronym>ISO</acronym> 書式を使用しましょう。既存のコードで <acronym>PHP</acronym> の日付書式をしているものがある場合は
  1151. <link linkend="zend.locale.date.normalize">Zend_Locale_Format::convertPhpToIsoFormat()</link>
  1152. で <acronym>ISO</acronym> 書式に変換するか、<methodname>setOptions()</methodname>
  1153. を使用します。次の例は、下の表の定数を用いて独自の書式を定義するものです。
  1154. </para>
  1155. <example id="zend.date.constants.phpformats.example-1">
  1156. <title>PHP の指定子を使用した独自書式</title>
  1157. <programlisting language="php"><![CDATA[
  1158. $locale = new Zend_Locale('de_AT');
  1159. Zend_Date::setOptions(array('format_type' => 'php'));
  1160. $date = new Zend_Date(1234567890, false, $locale);
  1161. // 出力は 'February 16, 2007, 3:36 am' のようになります
  1162. print $date->toString('F j, Y, g:i a');
  1163. print $date->toString("'Format:D M j G:i:s T Y='D M j G:i:s T Y");
  1164. ]]></programlisting>
  1165. </example>
  1166. <important>
  1167. <title>PHP の日付書式と定数の使用について</title>
  1168. <para>
  1169. <classname>Zend_Date</classname> の定数は
  1170. <acronym>ISO</acronym> 記法を使っているということに注意しましょう。
  1171. つまり、<classname>Zend_Date</classname> で <acronym>PHP</acronym>
  1172. 記法を使うように設定している場合は、<classname>Zend_Date</classname>
  1173. の定数は使えません。自分で書式を定義する必要があります。
  1174. この忠告に従わなければ、予期せぬ結果を得ることになるでしょう。
  1175. </para>
  1176. </important>
  1177. <para>
  1178. 次の表は、<acronym>PHP</acronym> の日付書式指定子とそれに対応する <classname>Zend_Date</classname> の定数、
  1179. そして同等な <acronym>CLDR</acronym>/ISO 書式指定子を示したものです。
  1180. たいていの場合は、もし <acronym>CLDR</acronym>/ISO 書式に同等のものがなければ
  1181. <methodname>Zend_Locale_Format::convertPhpToIsoFormat()</methodname>
  1182. で <acronym>PHP</acronym> の書式指定子がそのまま残されます。そして <classname>Zend_Date</classname>
  1183. のメソッドは、たとえ "ISO" 書式モードであったとしても、これらの
  1184. <acronym>PHP</acronym> "独特の" 書式指定を理解します。
  1185. </para>
  1186. <table id="zend.date.constants.phpformats.table">
  1187. <title>PHP の日付出力用の定数</title>
  1188. <tgroup cols="5">
  1189. <thead>
  1190. <row>
  1191. <entry>定数</entry>
  1192. <entry>説明</entry>
  1193. <entry>対応する要素</entry>
  1194. <entry><acronym>CLDR</acronym> での同等の指定子</entry>
  1195. <entry>結果</entry>
  1196. </row>
  1197. </thead>
  1198. <tbody>
  1199. <row>
  1200. <entry>d</entry>
  1201. <entry>その月の日付 (二桁)</entry>
  1202. <entry><constant>Zend_Date::DAY</constant></entry>
  1203. <entry>dd</entry>
  1204. <entry><emphasis>09</emphasis>
  1205. </entry>
  1206. </row>
  1207. <row>
  1208. <entry>D</entry>
  1209. <entry>曜日 (地域化された省略形、三文字)</entry>
  1210. <entry><constant>Zend_Date::WEEKDAY_SHORT</constant></entry>
  1211. <entry>EEE</entry>
  1212. <entry><emphasis>Mon</emphasis>
  1213. </entry>
  1214. </row>
  1215. <row>
  1216. <entry>j</entry>
  1217. <entry>その月の日付 (一桁あるいは二桁)</entry>
  1218. <entry><constant>Zend_Date::DAY_SHORT</constant></entry>
  1219. <entry>d</entry>
  1220. <entry><emphasis>9</emphasis>
  1221. </entry>
  1222. </row>
  1223. <row>
  1224. <entry>l (小文字の L)</entry>
  1225. <entry>曜日 (地域化された完全形)</entry>
  1226. <entry><constant>Zend_Date::WEEKDAY</constant></entry>
  1227. <entry>EEEE</entry>
  1228. <entry><emphasis>Monday</emphasis>
  1229. </entry>
  1230. </row>
  1231. <row>
  1232. <entry>N</entry>
  1233. <entry>曜日番号 (一桁)</entry>
  1234. <entry><constant>Zend_Date::WEEKDAY_8601</constant></entry>
  1235. <entry>e</entry>
  1236. <entry><emphasis>4</emphasis>
  1237. </entry>
  1238. </row>
  1239. <row>
  1240. <entry>S</entry>
  1241. <entry>英語の日付の後につける接尾辞 (二文字)</entry>
  1242. <entry>なし</entry>
  1243. <entry>なし</entry>
  1244. <entry><emphasis>st</emphasis>
  1245. </entry>
  1246. </row>
  1247. <row>
  1248. <entry>w</entry>
  1249. <entry>曜日番号 (0=日曜日、6=土曜日)</entry>
  1250. <entry><constant>Zend_Date::WEEKDAY_DIGIT</constant></entry>
  1251. <entry>なし</entry>
  1252. <entry><emphasis>4</emphasis>
  1253. </entry>
  1254. </row>
  1255. <row>
  1256. <entry>z</entry>
  1257. <entry>その年の日付 (一桁、二桁あるいは三桁)</entry>
  1258. <entry><constant>Zend_Date::DAY_OF_YEAR</constant></entry>
  1259. <entry>D</entry>
  1260. <entry><emphasis>7</emphasis>
  1261. </entry>
  1262. </row>
  1263. <row>
  1264. <entry>W</entry>
  1265. <entry>週 (一桁あるいは二桁)</entry>
  1266. <entry><constant>Zend_Date::WEEK</constant></entry>
  1267. <entry>w</entry>
  1268. <entry><emphasis>5</emphasis>
  1269. </entry>
  1270. </row>
  1271. <row>
  1272. <entry>F</entry>
  1273. <entry>月 (地域化された完全形)</entry>
  1274. <entry><constant>Zend_Date::MONTH_NAME</constant></entry>
  1275. <entry>MMMM</entry>
  1276. <entry><emphasis>February</emphasis>
  1277. </entry>
  1278. </row>
  1279. <row>
  1280. <entry>m</entry>
  1281. <entry>月 (二桁)</entry>
  1282. <entry><constant>Zend_Date::MONTH</constant></entry>
  1283. <entry>MM</entry>
  1284. <entry><emphasis>02</emphasis>
  1285. </entry>
  1286. </row>
  1287. <row>
  1288. <entry>M</entry>
  1289. <entry>月 (地域化された省略形)</entry>
  1290. <entry><constant>Zend_Date::MONTH_NAME_SHORT</constant></entry>
  1291. <entry>MMM</entry>
  1292. <entry><emphasis>Feb</emphasis>
  1293. </entry>
  1294. </row>
  1295. <row>
  1296. <entry>n</entry>
  1297. <entry>月 (一桁あるいは二桁)</entry>
  1298. <entry><constant>Zend_Date::MONTH_SHORT</constant></entry>
  1299. <entry>M</entry>
  1300. <entry><emphasis>2</emphasis>
  1301. </entry>
  1302. </row>
  1303. <row>
  1304. <entry>t</entry>
  1305. <entry>その月の日数 (一桁あるいは二桁)</entry>
  1306. <entry><constant>Zend_Date::MONTH_DAYS</constant></entry>
  1307. <entry>なし</entry>
  1308. <entry><emphasis>30</emphasis>
  1309. </entry>
  1310. </row>
  1311. <row>
  1312. <entry>L</entry>
  1313. <entry>うるう年かどうか</entry>
  1314. <entry><constant>Zend_Date::LEAPYEAR</constant></entry>
  1315. <entry>なし</entry>
  1316. <entry><emphasis>true</emphasis>
  1317. </entry>
  1318. </row>
  1319. <row>
  1320. <entry>o</entry>
  1321. <entry><acronym>ISO</acronym> 8601 形式の年 (最低四桁)</entry>
  1322. <entry><constant>Zend_Date::YEAR_8601</constant></entry>
  1323. <entry>YYYY</entry>
  1324. <entry><emphasis>2009</emphasis>
  1325. </entry>
  1326. </row>
  1327. <row>
  1328. <entry>Y</entry>
  1329. <entry>年 (最低四桁)</entry>
  1330. <entry><constant>Zend_Date::YEAR</constant></entry>
  1331. <entry>yyyy</entry>
  1332. <entry><emphasis>2009</emphasis>
  1333. </entry>
  1334. </row>
  1335. <row>
  1336. <entry>y</entry>
  1337. <entry>年 (最低二桁)</entry>
  1338. <entry><constant>Zend_Date::YEAR_SHORT</constant></entry>
  1339. <entry>yy</entry>
  1340. <entry><emphasis>09</emphasis>
  1341. </entry>
  1342. </row>
  1343. <row>
  1344. <entry>a</entry>
  1345. <entry>午前/午後 (地域化された形式)</entry>
  1346. <entry><constant>Zend_Date::MERIDIEM</constant></entry>
  1347. <entry>a (sort of, but likely to be uppercase)</entry>
  1348. <entry><emphasis>vorm.</emphasis>
  1349. </entry>
  1350. </row>
  1351. <row>
  1352. <entry>A</entry>
  1353. <entry>午前/午後 (地域化された形式)</entry>
  1354. <entry><constant>Zend_Date::MERIDIEM</constant></entry>
  1355. <entry>a (sort of, but no guarantee that the format is uppercase)</entry>
  1356. <entry><emphasis>VORM.</emphasis>
  1357. </entry>
  1358. </row>
  1359. <row>
  1360. <entry>B</entry>
  1361. <entry>Swatch インターネット時間</entry>
  1362. <entry><constant>Zend_Date::SWATCH</constant></entry>
  1363. <entry>なし</entry>
  1364. <entry><emphasis>1463</emphasis>
  1365. </entry>
  1366. </row>
  1367. <row>
  1368. <entry>g</entry>
  1369. <entry>時間 (1-12) (一桁あるいは二桁)</entry>
  1370. <entry><constant>Zend_Date::HOUR_SHORT_AM</constant></entry>
  1371. <entry>h</entry>
  1372. <entry><emphasis>2</emphasis>
  1373. </entry>
  1374. </row>
  1375. <row>
  1376. <entry>G</entry>
  1377. <entry>時間 (0-23) (一桁あるいは二桁)</entry>
  1378. <entry><constant>Zend_Date::HOUR_SHORT</constant></entry>
  1379. <entry>H</entry>
  1380. <entry><emphasis>2</emphasis>
  1381. </entry>
  1382. </row>
  1383. <row>
  1384. <entry>h</entry>
  1385. <entry>時間 (01-12) (二桁)</entry>
  1386. <entry><constant>Zend_Date::HOUR_AM</constant></entry>
  1387. <entry>hh</entry>
  1388. <entry><emphasis>02</emphasis>
  1389. </entry>
  1390. </row>
  1391. <row>
  1392. <entry>H</entry>
  1393. <entry>時間 (00-23) (二桁)</entry>
  1394. <entry><constant>Zend_Date::HOUR</constant></entry>
  1395. <entry>HH</entry>
  1396. <entry><emphasis>02</emphasis>
  1397. </entry>
  1398. </row>
  1399. <row>
  1400. <entry>i</entry>
  1401. <entry>分 (00-59) (二桁)</entry>
  1402. <entry><constant>Zend_Date::MINUTE</constant></entry>
  1403. <entry>mm</entry>
  1404. <entry><emphasis>02</emphasis>
  1405. </entry>
  1406. </row>
  1407. <row>
  1408. <entry>s</entry>
  1409. <entry>秒 (00-59) (二桁)</entry>
  1410. <entry><constant>Zend_Date::SECOND</constant></entry>
  1411. <entry>ss</entry>
  1412. <entry><emphasis>02</emphasis>
  1413. </entry>
  1414. </row>
  1415. <row>
  1416. <entry>e</entry>
  1417. <entry>タイムゾーン (地域化された完全形)</entry>
  1418. <entry><constant>Zend_Date::TIMEZONE_NAME</constant></entry>
  1419. <entry>zzzz</entry>
  1420. <entry><emphasis>Europe/Paris</emphasis>
  1421. </entry>
  1422. </row>
  1423. <row>
  1424. <entry>I</entry>
  1425. <entry>夏時間</entry>
  1426. <entry><constant>Zend_Date::DAYLIGHT</constant></entry>
  1427. <entry>なし</entry>
  1428. <entry><emphasis>1</emphasis>
  1429. </entry>
  1430. </row>
  1431. <row>
  1432. <entry>O</entry>
  1433. <entry>タイムゾーンの時差</entry>
  1434. <entry><constant>Zend_Date::GMT_DIFF</constant></entry>
  1435. <entry>Z、ZZ あるいは <constant>ZZZ</constant></entry>
  1436. <entry><emphasis>+0100</emphasis>
  1437. </entry>
  1438. </row>
  1439. <row>
  1440. <entry>P</entry>
  1441. <entry>タイムゾーンの時差 (分割形式)</entry>
  1442. <entry><constant>Zend_Date::GMT_DIFF_SEP</constant></entry>
  1443. <entry>ZZZZ</entry>
  1444. <entry><emphasis>+01:00</emphasis>
  1445. </entry>
  1446. </row>
  1447. <row>
  1448. <entry>T</entry>
  1449. <entry>タイムゾーン (地域化された省略形)</entry>
  1450. <entry><constant>Zend_Date::TIMEZONE</constant></entry>
  1451. <entry>z、zz あるいは zzz</entry>
  1452. <entry><emphasis>CET</emphasis>
  1453. </entry>
  1454. </row>
  1455. <row>
  1456. <entry>Z</entry>
  1457. <entry>タイムゾーンの時差秒数</entry>
  1458. <entry><constant>Zend_Date::TIMEZONE_SECS</constant></entry>
  1459. <entry>なし</entry>
  1460. <entry><emphasis>3600</emphasis>
  1461. </entry>
  1462. </row>
  1463. <row>
  1464. <entry>c</entry>
  1465. <entry>標準の Iso 書式の出力</entry>
  1466. <entry><constant>Zend_Date::ISO_8601</constant></entry>
  1467. <entry>なし</entry>
  1468. <entry><emphasis>2004-02-12T15:19:21+00:00</emphasis>
  1469. </entry>
  1470. </row>
  1471. <row>
  1472. <entry>r</entry>
  1473. <entry>標準の Rfc 2822 書式の出力</entry>
  1474. <entry><constant>Zend_Date::RFC_2822</constant></entry>
  1475. <entry>なし</entry>
  1476. <entry><emphasis>Thu, 21 Dec 2000 16:01:07 +0200</emphasis>
  1477. </entry>
  1478. </row>
  1479. <row>
  1480. <entry>U</entry>
  1481. <entry>Unix タイムスタンプ</entry>
  1482. <entry><constant>Zend_Date::TIMESTAMP</constant></entry>
  1483. <entry>なし</entry>
  1484. <entry><emphasis>15275422364</emphasis>
  1485. </entry>
  1486. </row>
  1487. </tbody>
  1488. </tgroup>
  1489. </table>
  1490. </sect2>
  1491. </sect1>