time
Return current Unix timestamp
Description
int time()
Note:
Unix timestamps do not contain any information with regards to any local
timezone. It is recommended to use the
DateTimeImmutable class for handling date and time
information in order to avoid the pitfalls that come with just Unix
timestamps.
Parameters
This function has no parameters.
Return Values
Returns the current timestamp.
Examples
Example #1 time example
<?php
echo 'Now: '. time();
?>
The above example will output
something similar to:
Notes
Tip
Timestamp of the start of the request is available in
$_SERVER['REQUEST_TIME'].
See Also
- DateTimeImmutable
- date
- microtime