開発環境
- OS X Lion - Apple(OS)
- Apache (Web Server)
- PHP (サーバーサイドプログラミング言語)
- TextWrangler(Text Editor) (BBEditの無料機能制限版、light版)
『初めてのPHP5』 (David Sklar 著、 桑村 潤 翻訳、 廣川 類 翻訳、 オライリー・ジャパン、2005年、ISBN978-4-87311-257-2)の9章(日付と時刻の取り扱い)9.6(演習問題)1を解いてみる。
1.
HTML、PHPのコード(TextWrangler)
<?php $timestamp = mktime(19,45,0,10,20,2004); print strftime("Today is day %d of %B and day %j of the year %Y. ". "The time is %I:%M %p<br />" . "(also known as %H:%M).", $timestamp); ?>
HTMLソース
Today is day 20 of October and day 294 of the year 2004. The time is 07:45 PM<br />(also known as 19:45).
0 コメント:
コメントを投稿