私はしばらくPHPを使用date()
していますが、時間をフォーマットするために使用する必要がある場合、時間の構文を正しく覚えることができません。g / G / h / Hを使用する理由と韻を覚えるためのトリックはありますか?
PHPマニュアルからdate()
:
g | 12-hour format of an hour without leading zeros | 1 through 12
G | 24-hour format of an hour without leading zeros | 0 through 23
h | 12-hour format of an hour with leading zeros | 01 through 12
H | 24-hour format of an hour with leading zeros | 00 through 23
および画像形式:
php-time.png http://img593.imageshack.us/img593/5338/phptime.png