PHP time() 関数

❮ PHP 日付/時刻リファレンス

Return the current time as a Unix timestamp, then format it to a date:

<?php
$t=time();
echo($t . "<br>");
echo(date("Y-m-d",$t));
?>
例の実行 »

定義と用法

time() function returns the current time in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).


構文

time();

技術内容
返り値: Returns an integer containing the current time as a Unix timestamp
PHP バージョン: 4+

❮ PHP 日付/時刻リファレンス