Zend_Date-Constants.xml 77 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <!-- EN-Revision: 24249 -->
  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. <!-- TODO : to be translated -->
  1354. <entry>a (sort of, but likely to be uppercase)</entry>
  1355. <entry><emphasis>vorm.</emphasis>
  1356. </entry>
  1357. </row>
  1358. <row>
  1359. <entry>A</entry>
  1360. <entry>午前/午後 (地域化された形式)</entry>
  1361. <entry><constant>Zend_Date::MERIDIEM</constant></entry>
  1362. <!-- TODO : to be translated -->
  1363. <entry>a (sort of, but no guarantee that the format is uppercase)</entry>
  1364. <entry><emphasis>VORM.</emphasis>
  1365. </entry>
  1366. </row>
  1367. <row>
  1368. <entry>B</entry>
  1369. <entry>Swatch インターネット時間</entry>
  1370. <entry><constant>Zend_Date::SWATCH</constant></entry>
  1371. <entry>なし</entry>
  1372. <entry><emphasis>1463</emphasis>
  1373. </entry>
  1374. </row>
  1375. <row>
  1376. <entry>g</entry>
  1377. <entry>時間 (1-12) (一桁あるいは二桁)</entry>
  1378. <entry><constant>Zend_Date::HOUR_SHORT_AM</constant></entry>
  1379. <entry>h</entry>
  1380. <entry><emphasis>2</emphasis>
  1381. </entry>
  1382. </row>
  1383. <row>
  1384. <entry>G</entry>
  1385. <entry>時間 (0-23) (一桁あるいは二桁)</entry>
  1386. <entry><constant>Zend_Date::HOUR_SHORT</constant></entry>
  1387. <entry>H</entry>
  1388. <entry><emphasis>2</emphasis>
  1389. </entry>
  1390. </row>
  1391. <row>
  1392. <entry>h</entry>
  1393. <entry>時間 (01-12) (二桁)</entry>
  1394. <entry><constant>Zend_Date::HOUR_AM</constant></entry>
  1395. <entry>hh</entry>
  1396. <entry><emphasis>02</emphasis>
  1397. </entry>
  1398. </row>
  1399. <row>
  1400. <entry>H</entry>
  1401. <entry>時間 (00-23) (二桁)</entry>
  1402. <entry><constant>Zend_Date::HOUR</constant></entry>
  1403. <entry>HH</entry>
  1404. <entry><emphasis>02</emphasis>
  1405. </entry>
  1406. </row>
  1407. <row>
  1408. <entry>i</entry>
  1409. <entry>分 (00-59) (二桁)</entry>
  1410. <entry><constant>Zend_Date::MINUTE</constant></entry>
  1411. <entry>mm</entry>
  1412. <entry><emphasis>02</emphasis>
  1413. </entry>
  1414. </row>
  1415. <row>
  1416. <entry>s</entry>
  1417. <entry>秒 (00-59) (二桁)</entry>
  1418. <entry><constant>Zend_Date::SECOND</constant></entry>
  1419. <entry>ss</entry>
  1420. <entry><emphasis>02</emphasis>
  1421. </entry>
  1422. </row>
  1423. <row>
  1424. <entry>e</entry>
  1425. <entry>タイムゾーン (地域化された完全形)</entry>
  1426. <entry><constant>Zend_Date::TIMEZONE_NAME</constant></entry>
  1427. <entry>zzzz</entry>
  1428. <entry><emphasis>Europe/Paris</emphasis>
  1429. </entry>
  1430. </row>
  1431. <row>
  1432. <entry>I</entry>
  1433. <entry>夏時間</entry>
  1434. <entry><constant>Zend_Date::DAYLIGHT</constant></entry>
  1435. <entry>なし</entry>
  1436. <entry><emphasis>1</emphasis>
  1437. </entry>
  1438. </row>
  1439. <row>
  1440. <entry>O</entry>
  1441. <entry>タイムゾーンの時差</entry>
  1442. <entry><constant>Zend_Date::GMT_DIFF</constant></entry>
  1443. <entry>Z、ZZ あるいは <constant>ZZZ</constant></entry>
  1444. <entry><emphasis>+0100</emphasis>
  1445. </entry>
  1446. </row>
  1447. <row>
  1448. <entry>P</entry>
  1449. <entry>タイムゾーンの時差 (分割形式)</entry>
  1450. <entry><constant>Zend_Date::GMT_DIFF_SEP</constant></entry>
  1451. <entry>ZZZZ</entry>
  1452. <entry><emphasis>+01:00</emphasis>
  1453. </entry>
  1454. </row>
  1455. <row>
  1456. <entry>T</entry>
  1457. <entry>タイムゾーン (地域化された省略形)</entry>
  1458. <entry><constant>Zend_Date::TIMEZONE</constant></entry>
  1459. <entry>z、zz あるいは zzz</entry>
  1460. <entry><emphasis>CET</emphasis>
  1461. </entry>
  1462. </row>
  1463. <row>
  1464. <entry>Z</entry>
  1465. <entry>タイムゾーンの時差秒数</entry>
  1466. <entry><constant>Zend_Date::TIMEZONE_SECS</constant></entry>
  1467. <entry>なし</entry>
  1468. <entry><emphasis>3600</emphasis>
  1469. </entry>
  1470. </row>
  1471. <row>
  1472. <entry>c</entry>
  1473. <entry>標準の Iso 書式の出力</entry>
  1474. <entry><constant>Zend_Date::ISO_8601</constant></entry>
  1475. <entry>なし</entry>
  1476. <entry><emphasis>2004-02-12T15:19:21+00:00</emphasis>
  1477. </entry>
  1478. </row>
  1479. <row>
  1480. <entry>r</entry>
  1481. <entry>標準の Rfc 2822 書式の出力</entry>
  1482. <entry><constant>Zend_Date::RFC_2822</constant></entry>
  1483. <entry>なし</entry>
  1484. <entry><emphasis>Thu, 21 Dec 2000 16:01:07 +0200</emphasis>
  1485. </entry>
  1486. </row>
  1487. <row>
  1488. <entry>U</entry>
  1489. <entry>Unix タイムスタンプ</entry>
  1490. <entry><constant>Zend_Date::TIMESTAMP</constant></entry>
  1491. <entry>なし</entry>
  1492. <entry><emphasis>15275422364</emphasis>
  1493. </entry>
  1494. </row>
  1495. </tbody>
  1496. </tgroup>
  1497. </table>
  1498. </sect2>
  1499. </sect1>