date()関数出力形式一覧表
<html> <head> <title>date()関数出力形式一覧表</title> </head> <body> <center> <table border="1" bordercolor="#666699" cellspacing="0" cellpadding="5"> <caption>date()関数出力形式一覧表</caption> <th> </th><th>説明</th><th>現在の値</th> <?php $array = array( "a" => "am/pm", "A" => "AM/PM", "s" => "秒(00〜59)", "i" => "分(00〜59)", "g" => "時(1〜12)", "h" => "時(01〜12)", "G" => "時(0〜23)", "H" => "時(00〜23)", "j" => "日(1〜31)", "d" => "日(01〜31)", "n" => "月(1〜12)", "m" => "月(01〜12)", "M" => "月(Jan,Feb・・・)", "F" => "月(January,February・・・)", "y" => "年(00,01・・・)", "Y" => "年(・・・2009,2010,2011・・・)", "w" => "曜日(0〜6)", "D" => "曜日(Sun,Mon・・・)", "l" => "曜日(Sunday,Monday・・・)", "t" => "月の日数(28〜31)", "z" => "今年1月1日からの日数", "U" => "1970年1月1日からの秒数", "L" => "うるう年(うるう年は1,うるう年以外は0)", "S" => "序数を表す接尾語(th〜nd)", "Z" => "タイムゾーンのオフセット値"); while(list($key, $value) = each($array)) { echo "<tr><td>$key</td><td>$value</td><td>", date($key), "</td></tr>\n"; } ?> </table> </center> </body> </html>
〔 実行する 〕