「PHP」関数getdate()で日付/時刻情報を取得する方法

説明
getdate ([ int $timestamp = time() ] ) : array
引数
$timestamp
タイムスタンプを指定します。
返り値
日付/時刻/曜日を連想配列を返します。

連想配列
“seconds" 0 ~ 59
“minutes" 0 ~ 59
“hours"  0~23
“mday" 1~31 月単位の日
“wday"  0~6
“mon" 1~12
“year" xxxx
“yday" 0~365
“weekday" Sunday ~Saturday

サンプルコード
<?php
$cft = getdate();
print_r($cft);
?>

実行結果
Array
(
[seconds] => 30
[minutes] => 48
[hours] => 11
[mday] => 17
[wday] => 2
[mon] => 6
[year] => 2020
[yday] => 167
[weekday] => Tuesday
[month] => June
[0] => 1055901520
)

PHP

Posted by arkgame