Home > Backend Development > PHP Problem > What does time in PHP mean?

What does time in PHP mean?

WBOY
Release: 2023-03-15 18:20:02
Original
2549 people have browsed it

In PHP, time means "time". It is a built-in function in PHP. It is used to return the number of seconds from the Unix epoch to the current time. The returned result is a Unix time containing the current time. The integer of the stamp. This function has no parameters and the syntax is "time()".

What does time in PHP mean?

The operating environment of this article: Windows 10 system, PHP version 7.1, Dell G3 computer

What does time in PHP mean?

## The #time() function returns the current time in seconds since the Unix epoch (January 1 1970 00:00:00 GMT).

time() is a built-in function in PHP, used to return the number of seconds from the Unix epoch to the current time (unix timestamp)

The syntax is:

time();
Copy after login

Return value: Returns an integer containing the Unix timestamp of the current time.

Examples are as follows:


<?php
$t=time();
echo($t . "<br>");
echo(date("Y-m-d",$t));
?>
Copy after login

Output results:

What does time in PHP mean?## Recommended learning: "

PHP Video Tutorial

The above is the detailed content of What does time in PHP mean?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template