w3resource

PHP: time() function

Description

The time() function returns the current time as Unix timestamp. The Unix timestamp measures time as a number of seconds since midnight of Greenwich Mean Time on January 1, 1970.

Version:

(PHP 4 and above)

Syntax:

time()

Return value:

Current Unix timestamp

Value Type: Integer.

Example:

<?php
$curr_time  = time();
echo(date('D F d Y', $curr_time));
?>

Sample Output:

Tue October 03 2017

Note : Since the time/date is not static, therefore the output may vary.

View the Example in the browser

See also

PHP Function Reference

Previous: strtotime
Next: Directory Functions chdir



Follow us on Facebook and Twitter for latest update.