がるの健忘録

エンジニアでゲーマーで講師で占い師なおいちゃんのブログです。

覚書:日付あつかうときはね…

どうも、PHP5.1系以降のお話らしいのですが。
いいから何も考えずに


date_default_timezone_set("Asia/Tokyo");
と一行突っ込んでおきましょう。日本なら、ですが。
これで心安らかに以下略。
# ってか、まさか思いっきりエラーでるとはねぇ………


ちなみに上述を忘れると、

Strict Standards: localtime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone etting, the TZ environment variable 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 行数

っていうメッセージを吐いてきます。
いやまぁ"It is not safe to rely on the system's timezone settings."って…「いいじゃんdefaultシステムの設定で」って思っちゃうのは気のせいでしょうか?
まぁ…わからなくもないんですがね。ほんの少しばかり。