time()

The time() function returns the current time measured in seconds from the Unix Epoch, Midnight GMT January 1, 1970.

Codebyte Example

The example below prints out the Unix timestamp for the current date.

Code
Output
Loading...

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn PHP on Codecademy