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();
技術内容/h2>
返り値: | Returns an integer containing the current time as a Unix timestamp |
---|---|
PHP バージョン: | 4+ |