PHP4で作成したスクリプトのPHP5での動作確認をしていたところ次のエラーが発生→「Warning: strftime() [function.strftime]: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function.In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Tokyo’ for ‘JST/9.0/no DST’ instead in (スクリプト名) on line (行番号)」

strftimeを呼び出したタイミングで発覚しましたが、日付に関する関数呼び出しでは必ず発生する様です。PHPスクリプト中で「date_default_timezone_set(‘Asia/Tokyo’);」と書くか、php.ini(設定ファイル)で「date.timezone=Asia/Tokyo」と書いても問題無いとのこと。(※地域がAsia / Tokyo)の場合


コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です