きんじょうひでき
o0h_
問: PHPの標準関数やクラスで扱える日時表現には、どんな形式があるかを知っていますか?
↓2025年6月6日に実行すると、全て同じ値になる例
date_default_timezone_set('Asia/Tokyo');
strtotime('now 00:00:00');
strtotime('today UTC - 9hours');
strtotime('midnight');
strtotime('noon - 12 hours');
strtotime('3 days ago 00:00:00 + 72 hour');
strtotime('Sat.');
strtotime('00:00');
strtotime('2026-06-26');
strtotime('06/06/26');
strtotime('2026-W23-6');
strtotime('2026.157');
答: たくさん!
そんな訳で、このLTでは、実際に使える日時表現を共有します。
php-srcにある構文定義ファイルとその解説を題材に、「日時、ちょっと分かる」を目指します。