Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
これらのstrtotime関数の結果と少し混乱しています。同じであると期待していますが、まったく異なる結果が得られます。
echo strtotime(date('Y-m-d h:i:s',time()).' +1 hour')."\n"; echo strtotime('now +1 hour')."\n";
結果:
date('Y-m-d h:i:s',time(): 1340117163 now +1 hour: 1340160363
私は何か間違ったことをしていますか?
問題は、date()に渡される文字列形式の「h」にあります。たくさん遊んでみたところ、違いは12時間で、完全に疑わしいことがわかりました。
H(明確な時間)を大文字にすると、あなたは元気になるはずです。:-)