Retrieve the current time as a Unix timestamp and format it as a date.
| <?php $t=time(); echo($t . “<br>”); echo(date(“Y-m-d”,$t)); ?> |
The time() function returns the current time as the number of seconds since the Unix Epoch (January 1, 1970, 00:00:00 GMT).
| time() |
|
Return Value: |
Returns an integer representing the current time as a Unix timestamp. |
|
PHP Version: |
4+ |