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



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/php/function-reference/time.php