Home  >  Article  >  Backend Development  >  What is timestamp in php program

What is timestamp in php program

angryTom
angryTomOriginal
2019-08-24 14:43:403050browse

What is timestamp in php program

This article mainly introduces timestamps in PHP. Friends who need it can refer to it. I hope it will be helpful to everyone.

Recommended tutorial:PHP video tutorial

## Timestamp (timestamp), one can represent one Data is complete, verifiable data that existed before a specific time, usually a sequence of characters that uniquely identifies a certain moment in time. Using data generated by digital signature technology, the signature object includes original file information, signature parameters, signature time and other information. It is widely used in intellectual property protection, contract signing, financial accounting, electronic quotation and bidding, stock trading, etc.

The timestamp refers to the total number of seconds from 00:00:00 GMT on January 1, 1970 (08:00:00 on January 1, 1970, Beijing time) to the present Number of seconds. In layman's terms, a timestamp is a piece of complete and verifiable data that represents the existence of a piece of data at a specific point in time. It is mainly proposed to provide users with an electronic evidence to prove the time when certain user data was generated. In practical applications, it can be used in all aspects including e-commerce and financial activities, and can especially be used to support the "non-repudiation" service of public key infrastructure.

PHP gets the timestamp

PHP provides the built-in function

time() to get the timestamp of the server’s current time .

Example:

<?php
    echo time();
?>

We can format it into the time and date format we need through functions such as date().

The typical range of valid timestamps is from 20:45:54 on December 13, 1901 to 03:14:07 on January 19, 2038 (this range conforms to the 32-bit signed integer minimum and maximum values). However, starting from 5.1.0, the problem that the year range can only be between 1901 and 2038 has been overcome.

Tips

time() The result obtained is always the current timestamp, so it is an unfixed value. If the timestamp is a negative number, then To push forward from 00:00:00 on January 1, 1970

The above is the detailed content of What is timestamp in php program. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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