PHP gets the current timestamp, and php gets the current time

Source: Internet
Author: User

PHP gets the current timestamp, and php gets the current time

PHP provides a special function to obtain the current timestamp, that is, the time () function.
The time () function obtains the current UNIX timestamp. The returned value is the number of seconds from the timestamp epoch (January 1, January 1, 1970 00:00:00 GMT) to the current timestamp.
Syntax: int time (void)
The time () function does not have a parameter. The return value is the integer of the UNIX timestamp.
For example, use the time () function to obtain the timestamp of the current time. The Code is as follows.


<? Php
Echo time (); // current Timestamp
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.