Home  >  Article  >  Backend Development  >  How to convert timestamp in php date

How to convert timestamp in php date

藏色散人
藏色散人Original
2020-10-23 09:34:452458browse

How to convert date to timestamp in php: First create a PHP sample file; then use the "echo strtotime("now"), "\n";" method to convert date to timestamp.

How to convert timestamp in php date

Recommended: "PHP Video Tutorial"

Use the strotime function, the code is as follows;

How to convert timestamp in php date

Extended information:

PHP strtotime() function

1.strtotime, a function that can convert American English format time strings.

2.strtotime() can create a timestamp of a certain moment in English natural language

3. Function syntax: int strtotime(string $time[,int $now])

4. Function: Convert date and time strings in US English format into unix timestamps.

The above is the detailed content of How to convert timestamp in php date. 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