time
Returns the current Unix timestamp (number of seconds since January 1, 1970 00:00:00 GMT).
Parameters
main.php
Return Values
int
Returns the current Unix timestamp
On success:Current timestamp as integer (seconds since Unix epoch)
On failure:Never fails - always returns current timestamp
Notes
- Returns seconds since January 1, 1970 00:00:00 GMT
- Does not include timezone information - always UTC-based
- Use for time calculations, session management, and caching
- More efficient than date() when you only need timestamp
Changelog
- Function has been available since PHP 4.0.0
Related Functions
date
Date/TimeFormats a local date and time according to the specified format string.
timeformattimestamp