Zend_Date-Constants.xml 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <!-- EN-Revision: 23246 -->
  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>曜日 (地域化された曜日名の短縮形。2ないし4文字)</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>曜日 (地域化された曜日名の短縮形。1ないし2文字)</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>月 (地域化された月名の短縮形。2ないし4文字)</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>月 (地域化された月名の短縮形。1ないし2文字)</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::RFC_3339</constant></entry>
  534. <entry>Date according to <acronym>RFC</acronym> 3339 (string)</entry>
  535. <entry>2009-02-13T14:53:27+01:00</entry>
  536. <entry><emphasis>2009-02-13T14:53:27+01:00</emphasis></entry>
  537. </row>
  538. <row>
  539. <entry><constant>Zend_Date::RSS</constant></entry>
  540. <entry><acronym>RSS</acronym> フィード形式の日付 (文字列)</entry>
  541. <entry>2009-02-13T14:53:27+01:00</entry>
  542. <entry><emphasis>Fri, 13 Feb 2009 14:53:27 +0100</emphasis>
  543. </entry>
  544. </row>
  545. <row>
  546. <entry><constant>Zend_Date::W3C</constant></entry>
  547. <entry>
  548. <acronym>HTML</acronym> あるいは <acronym>HTTP</acronym> 用の
  549. <acronym>W3C</acronym> 形式の日付 (文字列)
  550. </entry>
  551. <entry>2009-02-13T14:53:27+01:00</entry>
  552. <entry><emphasis>2009-02-13T14:53:27+01:00</emphasis>
  553. </entry>
  554. </row>
  555. </tbody>
  556. </tgroup>
  557. </table>
  558. <para>
  559. 特に注意すべきなのは <constant>Zend_Date::DATES</constant> です。これは、
  560. <classname>Zend_Date</classname> で <emphasis>入力</emphasis>
  561. フォーマットを指定する際に使用すると、特別な働きをします。
  562. 入力フォーマットとして <varname>$part</varname> で使用すると、
  563. この定数は、さまざまな類似日付書式をできるだけ受け入れようとします。
  564. 経験則にもとづいて入力日付文字列を自動的に分解し、単純なエラーを (もしあれば)
  565. できるだけ修正します。たとえば年、月、日の順序がおかしい場合などです。
  566. </para>
  567. <table id="zend.date.constants.list.table-8">
  568. <title>日付および時刻フォーマットに関する定数 (ロケールによって変化する書式)</title>
  569. <tgroup cols="4">
  570. <thead>
  571. <row>
  572. <entry>定数</entry>
  573. <entry>説明</entry>
  574. <entry>日付</entry>
  575. <entry>結果</entry>
  576. </row>
  577. </thead>
  578. <tbody>
  579. <row>
  580. <entry><constant>Zend_Date::ERA</constant></entry>
  581. <entry>時代 (地域化された文字列の短縮形)</entry>
  582. <entry>2009-02-13T14:53:27+01:00</entry>
  583. <entry><emphasis>AD</emphasis> (紀元後)</entry>
  584. </row>
  585. <row>
  586. <entry><constant>Zend_Date::ERA_NAME</constant></entry>
  587. <entry>時代 (地域化された文字列の完全系)</entry>
  588. <entry>2009-02-13T14:53:27+01:00</entry>
  589. <entry><emphasis>anno domini</emphasis> (紀元後)</entry>
  590. </row>
  591. <row>
  592. <entry><emphasis>Zend_Date::DATES</emphasis>
  593. </entry>
  594. <entry>標準の日付 (地域化された文字列、デフォルト値)</entry>
  595. <entry>2009-02-13T14:53:27+01:00</entry>
  596. <entry><emphasis>13.02.2009</emphasis>
  597. </entry>
  598. </row>
  599. <row>
  600. <entry><constant>Zend_Date::DATE_FULL</constant></entry>
  601. <entry>完全な日付 (地域化された文字列、完全形)</entry>
  602. <entry>2009-02-13T14:53:27+01:00</entry>
  603. <entry><emphasis>Friday, 13. February 2009</emphasis>
  604. </entry>
  605. </row>
  606. <row>
  607. <entry><constant>Zend_Date::DATE_LONG</constant></entry>
  608. <entry>長い日付 (地域化された文字列、長い形式)</entry>
  609. <entry>2009-02-13T14:53:27+01:00</entry>
  610. <entry><emphasis>13. February 2009</emphasis>
  611. </entry>
  612. </row>
  613. <row>
  614. <entry><constant>Zend_Date::DATE_MEDIUM</constant></entry>
  615. <entry>通常の日付 (地域化された文字列、通常の形式)</entry>
  616. <entry>2009-02-13T14:53:27+01:00</entry>
  617. <entry><emphasis>13.02.2009</emphasis>
  618. </entry>
  619. </row>
  620. <row>
  621. <entry><constant>Zend_Date::DATE_SHORT</constant></entry>
  622. <entry>省略形の日付 (地域化された文字列、短縮形式)</entry>
  623. <entry>2009-02-13T14:53:27+01:00</entry>
  624. <entry><emphasis>13.02.09</emphasis>
  625. </entry>
  626. </row>
  627. <row>
  628. <entry><constant>Zend_Date::TIMES</constant></entry>
  629. <entry>標準の時刻 (地域化された文字列、デフォルト値)</entry>
  630. <entry>2009-02-13T14:53:27+01:00</entry>
  631. <entry><emphasis>14:53:27</emphasis>
  632. </entry>
  633. </row>
  634. <row>
  635. <entry><constant>Zend_Date::TIME_FULL</constant></entry>
  636. <entry>完全な時刻 (地域化された文字列、完全形)</entry>
  637. <entry>2009-02-13T14:53:27+01:00</entry>
  638. <entry><emphasis>14:53 Uhr <acronym>CET</acronym></emphasis>
  639. </entry>
  640. </row>
  641. <row>
  642. <entry><constant>Zend_Date::TIME_LONG</constant></entry>
  643. <entry>長い時刻 (地域化された文字列、長い形式)</entry>
  644. <entry>2009-02-13T14:53:27+01:00</entry>
  645. <entry><emphasis>14:53:27 <acronym>CET</acronym></emphasis>
  646. </entry>
  647. </row>
  648. <row>
  649. <entry><constant>Zend_Date::TIME_MEDIUM</constant></entry>
  650. <entry>通常の時刻 (地域化された文字列、通常の形式)</entry>
  651. <entry>2009-02-13T14:53:27+01:00</entry>
  652. <entry><emphasis>14:53:27</emphasis>
  653. </entry>
  654. </row>
  655. <row>
  656. <entry><constant>Zend_Date::TIME_SHORT</constant></entry>
  657. <entry>省略形の時刻 (地域化された文字列、短縮形式)</entry>
  658. <entry>2009-02-13T14:53:27+01:00</entry>
  659. <entry><emphasis>14:53</emphasis>
  660. </entry>
  661. </row>
  662. <row>
  663. <entry><emphasis>Zend_Date::DATETIME</emphasis>
  664. </entry>
  665. <entry>標準の日付・時刻 (地域化された文字列、デフォルト値)</entry>
  666. <entry>2009-02-13T14:53:27+01:00</entry>
  667. <entry><emphasis>13.02.2009 14:53:27</emphasis>
  668. </entry>
  669. </row>
  670. <row>
  671. <entry><constant>Zend_Date::DATETIME_FULL</constant></entry>
  672. <entry>完全な日付・時刻 (地域化された文字列、完全な形式)</entry>
  673. <entry>2009-02-13T14:53:27+01:00</entry>
  674. <entry><emphasis>Friday, 13. February 2009 14:53 Uhr <acronym>CET</acronym></emphasis>
  675. </entry>
  676. </row>
  677. <row>
  678. <entry><constant>Zend_Date::DATETIME_LONG</constant></entry>
  679. <entry>長い日付・時刻 (地域化された文字列、長い形式)</entry>
  680. <entry>2009-02-13T14:53:27+01:00</entry>
  681. <entry><emphasis>13. February 2009 14:53:27 <acronym>CET</acronym></emphasis>
  682. </entry>
  683. </row>
  684. <row>
  685. <entry><constant>Zend_Date::DATETIME_MEDIUM</constant></entry>
  686. <entry>通常の日付・時刻 (地域化された文字列、通常の形式)</entry>
  687. <entry>2009-02-13T14:53:27+01:00</entry>
  688. <entry><emphasis>13.02.2009 14:53:27</emphasis>
  689. </entry>
  690. </row>
  691. <row>
  692. <entry><constant>Zend_Date::DATETIME_SHORT</constant></entry>
  693. <entry>省略形の日付・時刻 (地域化された文字列、短縮形式)</entry>
  694. <entry>2009-02-13T14:53:27+01:00</entry>
  695. <entry><emphasis>13.02.09 14:53</emphasis>
  696. </entry>
  697. </row>
  698. </tbody>
  699. </tgroup>
  700. </table>
  701. </sect2>
  702. <sect2 id="zend.date.constants.selfdefinedformats">
  703. <title>ISO 書式指定子を使用して自分で定義する出力フォーマット</title>
  704. <para>
  705. 上で示したもの意外の日付書式が必要な場合は、以下に示す
  706. <acronym>ISO</acronym> 書式トークンを使用して自分で書式を定義します。
  707. 以下の例は、下の表の定数を用いて独自の <acronym>ISO</acronym> 書式を作成する方法を示すものです。
  708. 書式の長さは無制限で、同じ定数を複数回使用してもかまいません。
  709. </para>
  710. <para>
  711. もし <acronym>PHP</acronym> 風の日付書式のほうがなじみがあるのなら、
  712. <acronym>ISO</acronym> 書式ではなく <acronym>PHP</acronym> の書式を用いるように変更することも可能です。
  713. しかし、<acronym>ISO</acronym> で定められているすべての書式が <acronym>PHP</acronym> の日付書式で指定できるわけではありません。
  714. <methodname>Zend_Date::setOptions(array('format_type' => 'php'))</methodname> メソッドを使用すると、
  715. <classname>Zend_Date</classname> のメソッドで <acronym>ISO</acronym> 書式指定子ではなく <acronym>PHP</acronym> の date() での指定子を用いるようになります
  716. (以下の <link linkend="zend.date.constants.phpformats">PHP の date() 関数の書式指定子を使用して
  717. 自分で定義する出力フォーマット</link> を参照ください)。
  718. </para>
  719. <example id="zend.date.constants.selfdefinedformats.example-1">
  720. <title>ISO 書式を使用した独自書式</title>
  721. <programlisting language="php"><![CDATA[
  722. $locale = new Zend_Locale('de_AT');
  723. $date = new Zend_Date(1234567890, false, $locale);
  724. print $date->toString("'Era:GGGG='GGGG, ' Date:yy.MMMM.dd'yy.MMMM.dd");
  725. ]]></programlisting>
  726. </example>
  727. <table id="zend.date.constants.selfdefinedformats.table">
  728. <title>ISO 8601 日付出力に関する定数</title>
  729. <tgroup cols="4">
  730. <thead>
  731. <row>
  732. <entry>定数</entry>
  733. <entry>説明</entry>
  734. <entry>対応する要素</entry>
  735. <entry>結果</entry>
  736. </row>
  737. </thead>
  738. <tbody>
  739. <row>
  740. <entry>G</entry>
  741. <entry>時代 (地域化された省略形)</entry>
  742. <entry><constant>Zend_Date::ERA</constant></entry>
  743. <entry><emphasis>AD</emphasis>
  744. </entry>
  745. </row>
  746. <row>
  747. <entry>GG</entry>
  748. <entry>時代 (地域化された省略形)</entry>
  749. <entry><constant>Zend_Date::ERA</constant></entry>
  750. <entry><emphasis>AD</emphasis>
  751. </entry>
  752. </row>
  753. <row>
  754. <entry><constant>GGG</constant></entry>
  755. <entry>時代 (地域化された省略形)</entry>
  756. <entry><constant>Zend_Date::ERA</constant></entry>
  757. <entry><emphasis>AD</emphasis>
  758. </entry>
  759. </row>
  760. <row>
  761. <entry><constant>GGGG</constant></entry>
  762. <entry>時代 (地域化された完全形)</entry>
  763. <entry><constant>Zend_Date::ERA_NAME</constant></entry>
  764. <entry><emphasis>anno domini</emphasis>
  765. </entry>
  766. </row>
  767. <row>
  768. <entry><constant>GGGGG</constant></entry>
  769. <entry>時代 (地域化された省略形)</entry>
  770. <entry><constant>Zend_Date::ERA</constant></entry>
  771. <entry><emphasis>a</emphasis>
  772. </entry>
  773. </row>
  774. <row>
  775. <entry>y</entry>
  776. <entry>年 (最低一桁)</entry>
  777. <entry><constant>Zend_Date::YEAR</constant></entry>
  778. <entry><emphasis>9</emphasis>
  779. </entry>
  780. </row>
  781. <row>
  782. <entry>yy</entry>
  783. <entry>年 (最低二桁)</entry>
  784. <entry><constant>Zend_Date::YEAR_SHORT</constant></entry>
  785. <entry><emphasis>09</emphasis>
  786. </entry>
  787. </row>
  788. <row>
  789. <entry>yyy</entry>
  790. <entry>年 (最低三桁)</entry>
  791. <entry><constant>Zend_Date::YEAR</constant></entry>
  792. <entry><emphasis>2009</emphasis>
  793. </entry>
  794. </row>
  795. <row>
  796. <entry>yyyy</entry>
  797. <entry>年 (最低四桁)</entry>
  798. <entry><constant>Zend_Date::YEAR</constant></entry>
  799. <entry><emphasis>2009</emphasis>
  800. </entry>
  801. </row>
  802. <row>
  803. <entry>yyyyy</entry>
  804. <entry>年 (最低五桁)</entry>
  805. <entry><constant>Zend_Date::YEAR</constant></entry>
  806. <entry><emphasis>02009</emphasis>
  807. </entry>
  808. </row>
  809. <row>
  810. <entry>Y</entry>
  811. <entry><acronym>ISO</acronym> 8601 形式の年 (最低一桁)</entry>
  812. <entry><constant>Zend_Date::YEAR_8601</constant></entry>
  813. <entry><emphasis>9</emphasis>
  814. </entry>
  815. </row>
  816. <row>
  817. <entry>YY</entry>
  818. <entry><acronym>ISO</acronym> 8601 形式の年 (最低二桁)</entry>
  819. <entry><constant>Zend_Date::YEAR_SHORT_8601</constant></entry>
  820. <entry><emphasis>09</emphasis>
  821. </entry>
  822. </row>
  823. <row>
  824. <entry><constant>YYY</constant></entry>
  825. <entry><acronym>ISO</acronym> 8601 形式の年 (最低三桁)</entry>
  826. <entry><constant>Zend_Date::YEAR_8601</constant></entry>
  827. <entry><emphasis>2009</emphasis>
  828. </entry>
  829. </row>
  830. <row>
  831. <entry><constant>YYYY</constant></entry>
  832. <entry><acronym>ISO</acronym> 8601 形式の年 (最低四桁)</entry>
  833. <entry><constant>Zend_Date::YEAR_8601</constant></entry>
  834. <entry><emphasis>2009</emphasis>
  835. </entry>
  836. </row>
  837. <row>
  838. <entry><constant>YYYYY</constant></entry>
  839. <entry><acronym>ISO</acronym> 8601 形式の年 (最低五桁)</entry>
  840. <entry><constant>Zend_Date::YEAR_8601</constant></entry>
  841. <entry><emphasis>02009</emphasis>
  842. </entry>
  843. </row>
  844. <row>
  845. <entry>M</entry>
  846. <entry>月 (一桁あるいは二桁)</entry>
  847. <entry><constant>Zend_Date::MONTH_SHORT</constant></entry>
  848. <entry><emphasis>2</emphasis>
  849. </entry>
  850. </row>
  851. <row>
  852. <entry>MM</entry>
  853. <entry>月 (二桁)</entry>
  854. <entry><constant>Zend_Date::MONTH</constant></entry>
  855. <entry><emphasis>02</emphasis>
  856. </entry>
  857. </row>
  858. <row>
  859. <entry><constant>MMM</constant></entry>
  860. <entry>月 (地域化された省略形)</entry>
  861. <entry><constant>Zend_Date::MONTH_NAME_SHORT</constant></entry>
  862. <entry><emphasis>Feb</emphasis>
  863. </entry>
  864. </row>
  865. <row>
  866. <entry><constant>MMMM</constant></entry>
  867. <entry>月 (地域化された完全形)</entry>
  868. <entry><constant>Zend_Date::MONTH_NAME</constant></entry>
  869. <entry><emphasis>February</emphasis>
  870. </entry>
  871. </row>
  872. <row>
  873. <entry><constant>MMMMM</constant></entry>
  874. <entry>月 (地域化された省略形、一桁)</entry>
  875. <entry><constant>Zend_Date::MONTH_NAME_NARROW</constant></entry>
  876. <entry><emphasis>F</emphasis>
  877. </entry>
  878. </row>
  879. <row>
  880. <entry>w</entry>
  881. <entry>週 (一桁あるいは二桁)</entry>
  882. <entry><constant>Zend_Date::WEEK</constant></entry>
  883. <entry><emphasis>5</emphasis>
  884. </entry>
  885. </row>
  886. <row>
  887. <entry>ww</entry>
  888. <entry>週 (二桁)</entry>
  889. <entry><constant>Zend_Date::WEEK</constant></entry>
  890. <entry><emphasis>05</emphasis>
  891. </entry>
  892. </row>
  893. <row>
  894. <entry>d</entry>
  895. <entry>その月の日付 (一桁あるいは二桁)</entry>
  896. <entry><constant>Zend_Date::DAY_SHORT</constant></entry>
  897. <entry><emphasis>9</emphasis>
  898. </entry>
  899. </row>
  900. <row>
  901. <entry>dd</entry>
  902. <entry>その月の日付 (二桁)</entry>
  903. <entry><constant>Zend_Date::DAY</constant></entry>
  904. <entry><emphasis>09</emphasis>
  905. </entry>
  906. </row>
  907. <row>
  908. <entry>D</entry>
  909. <entry>その年の日付 (一桁、二桁あるいは三桁)</entry>
  910. <entry><constant>Zend_Date::DAY_OF_YEAR</constant></entry>
  911. <entry><emphasis>7</emphasis>
  912. </entry>
  913. </row>
  914. <row>
  915. <entry>DD</entry>
  916. <entry>その年の日付 (二桁あるいは三桁)</entry>
  917. <entry><constant>Zend_Date::DAY_OF_YEAR</constant></entry>
  918. <entry><emphasis>07</emphasis>
  919. </entry>
  920. </row>
  921. <row>
  922. <entry><constant>DDD</constant></entry>
  923. <entry>その年の日付 (三桁)</entry>
  924. <entry><constant>Zend_Date::DAY_OF_YEAR</constant></entry>
  925. <entry><emphasis>007</emphasis>
  926. </entry>
  927. </row>
  928. <row>
  929. <entry>E</entry>
  930. <entry>曜日 (地域化された省略形、一文字)</entry>
  931. <entry><constant>Zend_Date::WEEKDAY_NARROW</constant></entry>
  932. <entry><emphasis>M</emphasis>
  933. </entry>
  934. </row>
  935. <row>
  936. <entry>EE</entry>
  937. <entry>曜日 (地域化された省略形、二文字以上)</entry>
  938. <entry><constant>Zend_Date::WEEKDAY_NAME</constant></entry>
  939. <entry><emphasis>Mo</emphasis>
  940. </entry>
  941. </row>
  942. <row>
  943. <entry><constant>EEE</constant></entry>
  944. <entry>曜日 (地域化された省略形、三文字)</entry>
  945. <entry><constant>Zend_Date::WEEKDAY_SHORT</constant></entry>
  946. <entry><emphasis>Mon</emphasis>
  947. </entry>
  948. </row>
  949. <row>
  950. <entry><constant>EEEE</constant></entry>
  951. <entry>曜日 (地域化された完全形)</entry>
  952. <entry><constant>Zend_Date::WEEKDAY</constant></entry>
  953. <entry><emphasis>Monday</emphasis>
  954. </entry>
  955. </row>
  956. <row>
  957. <entry><constant>EEEEE</constant></entry>
  958. <entry>曜日 (地域化された省略形、一桁)</entry>
  959. <entry><constant>Zend_Date::WEEKDAY_NARROW</constant></entry>
  960. <entry><emphasis>M</emphasis>
  961. </entry>
  962. </row>
  963. <row>
  964. <entry>e</entry>
  965. <entry>曜日番号 (一桁)</entry>
  966. <entry><constant>Zend_Date::WEEKDAY_DIGIT</constant></entry>
  967. <entry><emphasis>4</emphasis>
  968. </entry>
  969. </row>
  970. <row>
  971. <entry>ee</entry>
  972. <entry>曜日番号 (二桁)</entry>
  973. <entry><constant>Zend_Date::WEEKDAY_NARROW</constant></entry>
  974. <entry><emphasis>04</emphasis>
  975. </entry>
  976. </row>
  977. <row>
  978. <entry>a</entry>
  979. <entry>午前/午後 (地域化された形式)</entry>
  980. <entry><constant>Zend_Date::MERIDIEM</constant></entry>
  981. <entry><emphasis>vorm.</emphasis>
  982. </entry>
  983. </row>
  984. <row>
  985. <entry>h</entry>
  986. <entry>時間 (1-12) (一桁あるいは二桁)</entry>
  987. <entry><constant>Zend_Date::HOUR_SHORT_AM</constant></entry>
  988. <entry><emphasis>2</emphasis>
  989. </entry>
  990. </row>
  991. <row>
  992. <entry>hh</entry>
  993. <entry>時間 (01-12) (二桁)</entry>
  994. <entry><constant>Zend_Date::HOUR_AM</constant></entry>
  995. <entry><emphasis>02</emphasis>
  996. </entry>
  997. </row>
  998. <row>
  999. <entry>H</entry>
  1000. <entry>時間 (0-23) (一桁あるいは二桁)</entry>
  1001. <entry><constant>Zend_Date::HOUR_SHORT</constant></entry>
  1002. <entry><emphasis>2</emphasis>
  1003. </entry>
  1004. </row>
  1005. <row>
  1006. <entry>HH</entry>
  1007. <entry>時間 (00-23) (二桁)</entry>
  1008. <entry><constant>Zend_Date::HOUR</constant></entry>
  1009. <entry><emphasis>02</emphasis>
  1010. </entry>
  1011. </row>
  1012. <row>
  1013. <entry>m</entry>
  1014. <entry>分 (0-59) (一桁あるいは二桁)</entry>
  1015. <entry><constant>Zend_Date::MINUTE_SHORT</constant></entry>
  1016. <entry><emphasis>2</emphasis>
  1017. </entry>
  1018. </row>
  1019. <row>
  1020. <entry>mm</entry>
  1021. <entry>分 (00-59) (二桁)</entry>
  1022. <entry><constant>Zend_Date::MINUTE</constant></entry>
  1023. <entry><emphasis>02</emphasis>
  1024. </entry>
  1025. </row>
  1026. <row>
  1027. <entry>s</entry>
  1028. <entry>秒 (0-59) (一桁あるいは二桁)</entry>
  1029. <entry><constant>Zend_Date::SECOND_SHORT</constant></entry>
  1030. <entry><emphasis>2</emphasis>
  1031. </entry>
  1032. </row>
  1033. <row>
  1034. <entry>ss</entry>
  1035. <entry>秒 (00-59) (二桁)</entry>
  1036. <entry><constant>Zend_Date::SECOND</constant></entry>
  1037. <entry><emphasis>02</emphasis>
  1038. </entry>
  1039. </row>
  1040. <row>
  1041. <entry>S</entry>
  1042. <entry>ミリ秒</entry>
  1043. <entry><constant>Zend_Date::MILLISECOND</constant></entry>
  1044. <entry><emphasis>20536</emphasis>
  1045. </entry>
  1046. </row>
  1047. <row>
  1048. <entry>z</entry>
  1049. <entry>タイムゾーン (地域化された省略形)</entry>
  1050. <entry><constant>Zend_Date::TIMEZONE</constant></entry>
  1051. <entry><emphasis>CET</emphasis>
  1052. </entry>
  1053. </row>
  1054. <row>
  1055. <entry>zz</entry>
  1056. <entry>タイムゾーン (地域化された省略形)</entry>
  1057. <entry><constant>Zend_Date::TIMEZONE</constant></entry>
  1058. <entry><emphasis>CET</emphasis>
  1059. </entry>
  1060. </row>
  1061. <row>
  1062. <entry>zzz</entry>
  1063. <entry>タイムゾーン (地域化された省略形)</entry>
  1064. <entry><constant>Zend_Date::TIMEZONE</constant></entry>
  1065. <entry><emphasis>CET</emphasis>
  1066. </entry>
  1067. </row>
  1068. <row>
  1069. <entry>zzzz</entry>
  1070. <entry>タイムゾーン (地域化された完全形)</entry>
  1071. <entry><constant>Zend_Date::TIMEZONE_NAME</constant></entry>
  1072. <entry><emphasis>Europe/Paris</emphasis>
  1073. </entry>
  1074. </row>
  1075. <row>
  1076. <entry>Z</entry>
  1077. <entry>タイムゾーンの時差</entry>
  1078. <entry><constant>Zend_Date::GMT_DIFF</constant></entry>
  1079. <entry><emphasis>+0100</emphasis>
  1080. </entry>
  1081. </row>
  1082. <row>
  1083. <entry>ZZ</entry>
  1084. <entry>タイムゾーンの時差</entry>
  1085. <entry><constant>Zend_Date::GMT_DIFF</constant></entry>
  1086. <entry><emphasis>+0100</emphasis>
  1087. </entry>
  1088. </row>
  1089. <row>
  1090. <entry><constant>ZZZ</constant></entry>
  1091. <entry>タイムゾーンの時差</entry>
  1092. <entry><constant>Zend_Date::GMT_DIFF</constant></entry>
  1093. <entry><emphasis>+0100</emphasis>
  1094. </entry>
  1095. </row>
  1096. <row>
  1097. <entry><constant>ZZZZ</constant></entry>
  1098. <entry>タイムゾーンの時差 (分割形式)</entry>
  1099. <entry><constant>Zend_Date::GMT_DIFF_SEP</constant></entry>
  1100. <entry><emphasis>+01:00</emphasis>
  1101. </entry>
  1102. </row>
  1103. <row>
  1104. <entry>A</entry>
  1105. <entry>実績日付からのミリ秒</entry>
  1106. <entry><constant>Zend_Date::MILLISECOND</constant></entry>
  1107. <entry><emphasis>20563</emphasis>
  1108. </entry>
  1109. </row>
  1110. </tbody>
  1111. </tgroup>
  1112. </table>
  1113. <note>
  1114. <para>
  1115. デフォルトの <acronym>ISO</acronym> フォーマットは、<acronym>PHP</acronym> のフォーマットとは異なることに注意しましょう。
  1116. これまでに使ったことがない方は、少々いらいらするかもしれません。
  1117. 特に、<emphasis>「年」と「分」</emphasis>
  1118. に関する指定子については、なかなか期待通りに動作しないことでしょう。
  1119. </para>
  1120. <para>
  1121. <emphasis>「年」</emphasis>
  1122. については、間違えやすい指定子がふたつあります。
  1123. <acronym>ISO</acronym> 形式の年を表す <emphasis>Y</emphasis> 指定子と、
  1124. 実際の年を表す <emphasis>y</emphasis> 指定子です。
  1125. 両者の違いは些細なものではありますが、非常に重要です。
  1126. <emphasis>Y</emphasis> は <acronym>ISO</acronym> 形式の年を算出するものです。
  1127. これは、カレンダーを作成する際によく用いられます。
  1128. 2007 年 12 月 31 日を例にとって考えてみましょう。
  1129. 実際の年は 2007 ですが、この日は
  1130. 2008 年の最初の週 (第 1 週) の最初の日でもあります。
  1131. したがって、'dd.MM.yyyy' として場合は '31.December.2007'
  1132. が得られますが、'dd.MM.YYYY' とした場合の結果は '31.December.2008'
  1133. となるのです。これはバグではなく、期待通りの振る舞いです。
  1134. これが、ふたつの指定子の違いとなります。
  1135. </para>
  1136. <para>
  1137. <emphasis>「分」</emphasis>
  1138. の場合は、違いはそれほど大きくはありません。<acronym>ISO</acronym> では「分」
  1139. を表す指定子として <emphasis>m</emphasis>
  1140. を使用します。<acronym>PHP</acronym> が使っている <emphasis>i</emphasis>
  1141. ではありません。分を取得する書式指定をする際には、
  1142. 正しい指定子を使っているかどうかを確認するようにしましょう。
  1143. </para>
  1144. </note>
  1145. </sect2>
  1146. <sect2 id="zend.date.constants.phpformats">
  1147. <title>PHP の date() 関数の書式指定子を使用して自分で定義する出力フォーマット</title>
  1148. <para>
  1149. もし <acronym>PHP</acronym> の日付書式指定子のほうが <acronym>ISO</acronym> 書式指定子よりなじみがあるのなら、
  1150. <methodname>Zend_Date::setOptions(array('format_type' => 'php'))</methodname> を使用しましょう。これで、
  1151. <classname>Zend_Date</classname> のメソッドで <acronym>ISO</acronym> 書式指定子ではなく <acronym>PHP</acronym> の date() での指定子を用いるようになります
  1152. その後の書式パラメータは、すべて
  1153. <ulink url="http://php.net/date"><acronym>PHP</acronym> の <methodname>date()</methodname> 書式指定子</ulink>
  1154. に従うようになります。<acronym>PHP</acronym> の日付書式には含まれていないけれども <acronym>ISO</acronym> の書式には含まれるもの、
  1155. またその逆もあります。もしそれほど <acronym>PHP</acronym> の日付書式になじみがないのなら、標準の
  1156. <acronym>ISO</acronym> 書式を使用しましょう。既存のコードで <acronym>PHP</acronym> の日付書式をしているものがある場合は
  1157. <link linkend="zend.locale.date.normalize">Zend_Locale_Format::convertPhpToIsoFormat()</link>
  1158. で <acronym>ISO</acronym> 書式に変換するか、<methodname>setOptions()</methodname>
  1159. を使用します。次の例は、下の表の定数を用いて独自の書式を定義するものです。
  1160. </para>
  1161. <example id="zend.date.constants.phpformats.example-1">
  1162. <title>PHP の指定子を使用した独自書式</title>
  1163. <programlisting language="php"><![CDATA[
  1164. $locale = new Zend_Locale('de_AT');
  1165. Zend_Date::setOptions(array('format_type' => 'php'));
  1166. $date = new Zend_Date(1234567890, false, $locale);
  1167. // 出力は 'February 16, 2007, 3:36 am' のようになります
  1168. print $date->toString('F j, Y, g:i a');
  1169. print $date->toString("'Format:D M j G:i:s T Y='D M j G:i:s T Y");
  1170. ]]></programlisting>
  1171. </example>
  1172. <important>
  1173. <title>PHP の日付書式と定数の使用について</title>
  1174. <para>
  1175. <classname>Zend_Date</classname> の定数は
  1176. <acronym>ISO</acronym> 記法を使っているということに注意しましょう。
  1177. つまり、<classname>Zend_Date</classname> で <acronym>PHP</acronym>
  1178. 記法を使うように設定している場合は、<classname>Zend_Date</classname>
  1179. の定数は使えません。自分で書式を定義する必要があります。
  1180. この忠告に従わなければ、予期せぬ結果を得ることになるでしょう。
  1181. </para>
  1182. </important>
  1183. <para>
  1184. 次の表は、<acronym>PHP</acronym> の日付書式指定子とそれに対応する <classname>Zend_Date</classname> の定数、
  1185. そして同等な <acronym>CLDR</acronym>/ISO 書式指定子を示したものです。
  1186. たいていの場合は、もし <acronym>CLDR</acronym>/ISO 書式に同等のものがなければ
  1187. <methodname>Zend_Locale_Format::convertPhpToIsoFormat()</methodname>
  1188. で <acronym>PHP</acronym> の書式指定子がそのまま残されます。そして <classname>Zend_Date</classname>
  1189. のメソッドは、たとえ "ISO" 書式モードであったとしても、これらの
  1190. <acronym>PHP</acronym> "独特の" 書式指定を理解します。
  1191. </para>
  1192. <table id="zend.date.constants.phpformats.table">
  1193. <title>PHP の日付出力用の定数</title>
  1194. <tgroup cols="5">
  1195. <thead>
  1196. <row>
  1197. <entry>定数</entry>
  1198. <entry>説明</entry>
  1199. <entry>対応する要素</entry>
  1200. <entry><acronym>CLDR</acronym> での同等の指定子</entry>
  1201. <entry>結果</entry>
  1202. </row>
  1203. </thead>
  1204. <tbody>
  1205. <row>
  1206. <entry>d</entry>
  1207. <entry>その月の日付 (二桁)</entry>
  1208. <entry><constant>Zend_Date::DAY</constant></entry>
  1209. <entry>dd</entry>
  1210. <entry><emphasis>09</emphasis>
  1211. </entry>
  1212. </row>
  1213. <row>
  1214. <entry>D</entry>
  1215. <entry>曜日 (地域化された省略形、三文字)</entry>
  1216. <entry><constant>Zend_Date::WEEKDAY_SHORT</constant></entry>
  1217. <entry>EEE</entry>
  1218. <entry><emphasis>Mon</emphasis>
  1219. </entry>
  1220. </row>
  1221. <row>
  1222. <entry>j</entry>
  1223. <entry>その月の日付 (一桁あるいは二桁)</entry>
  1224. <entry><constant>Zend_Date::DAY_SHORT</constant></entry>
  1225. <entry>d</entry>
  1226. <entry><emphasis>9</emphasis>
  1227. </entry>
  1228. </row>
  1229. <row>
  1230. <entry>l (小文字の L)</entry>
  1231. <entry>曜日 (地域化された完全形)</entry>
  1232. <entry><constant>Zend_Date::WEEKDAY</constant></entry>
  1233. <entry>EEEE</entry>
  1234. <entry><emphasis>Monday</emphasis>
  1235. </entry>
  1236. </row>
  1237. <row>
  1238. <entry>N</entry>
  1239. <entry>曜日番号 (一桁)</entry>
  1240. <entry><constant>Zend_Date::WEEKDAY_8601</constant></entry>
  1241. <entry>e</entry>
  1242. <entry><emphasis>4</emphasis>
  1243. </entry>
  1244. </row>
  1245. <row>
  1246. <entry>S</entry>
  1247. <entry>英語の日付の後につける接尾辞 (二文字)</entry>
  1248. <entry>なし</entry>
  1249. <entry>なし</entry>
  1250. <entry><emphasis>st</emphasis>
  1251. </entry>
  1252. </row>
  1253. <row>
  1254. <entry>w</entry>
  1255. <entry>曜日番号 (0=日曜日、6=土曜日)</entry>
  1256. <entry><constant>Zend_Date::WEEKDAY_DIGIT</constant></entry>
  1257. <entry>なし</entry>
  1258. <entry><emphasis>4</emphasis>
  1259. </entry>
  1260. </row>
  1261. <row>
  1262. <entry>z</entry>
  1263. <entry>その年の日付 (一桁、二桁あるいは三桁)</entry>
  1264. <entry><constant>Zend_Date::DAY_OF_YEAR</constant></entry>
  1265. <entry>D</entry>
  1266. <entry><emphasis>7</emphasis>
  1267. </entry>
  1268. </row>
  1269. <row>
  1270. <entry>W</entry>
  1271. <entry>週 (一桁あるいは二桁)</entry>
  1272. <entry><constant>Zend_Date::WEEK</constant></entry>
  1273. <entry>w</entry>
  1274. <entry><emphasis>5</emphasis>
  1275. </entry>
  1276. </row>
  1277. <row>
  1278. <entry>F</entry>
  1279. <entry>月 (地域化された完全形)</entry>
  1280. <entry><constant>Zend_Date::MONTH_NAME</constant></entry>
  1281. <entry>MMMM</entry>
  1282. <entry><emphasis>February</emphasis>
  1283. </entry>
  1284. </row>
  1285. <row>
  1286. <entry>m</entry>
  1287. <entry>月 (二桁)</entry>
  1288. <entry><constant>Zend_Date::MONTH</constant></entry>
  1289. <entry>MM</entry>
  1290. <entry><emphasis>02</emphasis>
  1291. </entry>
  1292. </row>
  1293. <row>
  1294. <entry>M</entry>
  1295. <entry>月 (地域化された省略形)</entry>
  1296. <entry><constant>Zend_Date::MONTH_NAME_SHORT</constant></entry>
  1297. <entry>MMM</entry>
  1298. <entry><emphasis>Feb</emphasis>
  1299. </entry>
  1300. </row>
  1301. <row>
  1302. <entry>n</entry>
  1303. <entry>月 (一桁あるいは二桁)</entry>
  1304. <entry><constant>Zend_Date::MONTH_SHORT</constant></entry>
  1305. <entry>M</entry>
  1306. <entry><emphasis>2</emphasis>
  1307. </entry>
  1308. </row>
  1309. <row>
  1310. <entry>t</entry>
  1311. <entry>その月の日数 (一桁あるいは二桁)</entry>
  1312. <entry><constant>Zend_Date::MONTH_DAYS</constant></entry>
  1313. <entry>なし</entry>
  1314. <entry><emphasis>30</emphasis>
  1315. </entry>
  1316. </row>
  1317. <row>
  1318. <entry>L</entry>
  1319. <entry>うるう年かどうか</entry>
  1320. <entry><constant>Zend_Date::LEAPYEAR</constant></entry>
  1321. <entry>なし</entry>
  1322. <entry><emphasis><constant>TRUE</constant></emphasis>
  1323. </entry>
  1324. </row>
  1325. <row>
  1326. <entry>o</entry>
  1327. <entry><acronym>ISO</acronym> 8601 形式の年 (最低四桁)</entry>
  1328. <entry><constant>Zend_Date::YEAR_8601</constant></entry>
  1329. <entry>YYYY</entry>
  1330. <entry><emphasis>2009</emphasis>
  1331. </entry>
  1332. </row>
  1333. <row>
  1334. <entry>Y</entry>
  1335. <entry>年 (最低四桁)</entry>
  1336. <entry><constant>Zend_Date::YEAR</constant></entry>
  1337. <entry>yyyy</entry>
  1338. <entry><emphasis>2009</emphasis>
  1339. </entry>
  1340. </row>
  1341. <row>
  1342. <entry>y</entry>
  1343. <entry>年 (最低二桁)</entry>
  1344. <entry><constant>Zend_Date::YEAR_SHORT</constant></entry>
  1345. <entry>yy</entry>
  1346. <entry><emphasis>09</emphasis>
  1347. </entry>
  1348. </row>
  1349. <row>
  1350. <entry>a</entry>
  1351. <entry>午前/午後 (地域化された形式)</entry>
  1352. <entry><constant>Zend_Date::MERIDIEM</constant></entry>
  1353. <entry>a (sort of, but likely to be uppercase)</entry>
  1354. <entry><emphasis>vorm.</emphasis>
  1355. </entry>
  1356. </row>
  1357. <row>
  1358. <entry>A</entry>
  1359. <entry>午前/午後 (地域化された形式)</entry>
  1360. <entry><constant>Zend_Date::MERIDIEM</constant></entry>
  1361. <entry>a (sort of, but no guarantee that the format is uppercase)</entry>
  1362. <entry><emphasis>VORM.</emphasis>
  1363. </entry>
  1364. </row>
  1365. <row>
  1366. <entry>B</entry>
  1367. <entry>Swatch インターネット時間</entry>
  1368. <entry><constant>Zend_Date::SWATCH</constant></entry>
  1369. <entry>なし</entry>
  1370. <entry><emphasis>1463</emphasis>
  1371. </entry>
  1372. </row>
  1373. <row>
  1374. <entry>g</entry>
  1375. <entry>時間 (1-12) (一桁あるいは二桁)</entry>
  1376. <entry><constant>Zend_Date::HOUR_SHORT_AM</constant></entry>
  1377. <entry>h</entry>
  1378. <entry><emphasis>2</emphasis>
  1379. </entry>
  1380. </row>
  1381. <row>
  1382. <entry>G</entry>
  1383. <entry>時間 (0-23) (一桁あるいは二桁)</entry>
  1384. <entry><constant>Zend_Date::HOUR_SHORT</constant></entry>
  1385. <entry>H</entry>
  1386. <entry><emphasis>2</emphasis>
  1387. </entry>
  1388. </row>
  1389. <row>
  1390. <entry>h</entry>
  1391. <entry>時間 (01-12) (二桁)</entry>
  1392. <entry><constant>Zend_Date::HOUR_AM</constant></entry>
  1393. <entry>hh</entry>
  1394. <entry><emphasis>02</emphasis>
  1395. </entry>
  1396. </row>
  1397. <row>
  1398. <entry>H</entry>
  1399. <entry>時間 (00-23) (二桁)</entry>
  1400. <entry><constant>Zend_Date::HOUR</constant></entry>
  1401. <entry>HH</entry>
  1402. <entry><emphasis>02</emphasis>
  1403. </entry>
  1404. </row>
  1405. <row>
  1406. <entry>i</entry>
  1407. <entry>分 (00-59) (二桁)</entry>
  1408. <entry><constant>Zend_Date::MINUTE</constant></entry>
  1409. <entry>mm</entry>
  1410. <entry><emphasis>02</emphasis>
  1411. </entry>
  1412. </row>
  1413. <row>
  1414. <entry>s</entry>
  1415. <entry>秒 (00-59) (二桁)</entry>
  1416. <entry><constant>Zend_Date::SECOND</constant></entry>
  1417. <entry>ss</entry>
  1418. <entry><emphasis>02</emphasis>
  1419. </entry>
  1420. </row>
  1421. <row>
  1422. <entry>e</entry>
  1423. <entry>タイムゾーン (地域化された完全形)</entry>
  1424. <entry><constant>Zend_Date::TIMEZONE_NAME</constant></entry>
  1425. <entry>zzzz</entry>
  1426. <entry><emphasis>Europe/Paris</emphasis>
  1427. </entry>
  1428. </row>
  1429. <row>
  1430. <entry>I</entry>
  1431. <entry>夏時間</entry>
  1432. <entry><constant>Zend_Date::DAYLIGHT</constant></entry>
  1433. <entry>なし</entry>
  1434. <entry><emphasis>1</emphasis>
  1435. </entry>
  1436. </row>
  1437. <row>
  1438. <entry>O</entry>
  1439. <entry>タイムゾーンの時差</entry>
  1440. <entry><constant>Zend_Date::GMT_DIFF</constant></entry>
  1441. <entry>Z、ZZ あるいは <constant>ZZZ</constant></entry>
  1442. <entry><emphasis>+0100</emphasis>
  1443. </entry>
  1444. </row>
  1445. <row>
  1446. <entry>P</entry>
  1447. <entry>タイムゾーンの時差 (分割形式)</entry>
  1448. <entry><constant>Zend_Date::GMT_DIFF_SEP</constant></entry>
  1449. <entry>ZZZZ</entry>
  1450. <entry><emphasis>+01:00</emphasis>
  1451. </entry>
  1452. </row>
  1453. <row>
  1454. <entry>T</entry>
  1455. <entry>タイムゾーン (地域化された省略形)</entry>
  1456. <entry><constant>Zend_Date::TIMEZONE</constant></entry>
  1457. <entry>z、zz あるいは zzz</entry>
  1458. <entry><emphasis>CET</emphasis>
  1459. </entry>
  1460. </row>
  1461. <row>
  1462. <entry>Z</entry>
  1463. <entry>タイムゾーンの時差秒数</entry>
  1464. <entry><constant>Zend_Date::TIMEZONE_SECS</constant></entry>
  1465. <entry>なし</entry>
  1466. <entry><emphasis>3600</emphasis>
  1467. </entry>
  1468. </row>
  1469. <row>
  1470. <entry>c</entry>
  1471. <entry>標準の Iso 書式の出力</entry>
  1472. <entry><constant>Zend_Date::ISO_8601</constant></entry>
  1473. <entry>なし</entry>
  1474. <entry><emphasis>2004-02-12T15:19:21+00:00</emphasis>
  1475. </entry>
  1476. </row>
  1477. <row>
  1478. <entry>r</entry>
  1479. <entry>標準の Rfc 2822 書式の出力</entry>
  1480. <entry><constant>Zend_Date::RFC_2822</constant></entry>
  1481. <entry>なし</entry>
  1482. <entry><emphasis>Thu, 21 Dec 2000 16:01:07 +0200</emphasis>
  1483. </entry>
  1484. </row>
  1485. <row>
  1486. <entry>U</entry>
  1487. <entry>Unix タイムスタンプ</entry>
  1488. <entry><constant>Zend_Date::TIMESTAMP</constant></entry>
  1489. <entry>なし</entry>
  1490. <entry><emphasis>15275422364</emphasis>
  1491. </entry>
  1492. </row>
  1493. </tbody>
  1494. </tgroup>
  1495. </table>
  1496. </sect2>
  1497. </sect1>