In PHP, there is a function called Strtotime. Strtotime implementation: Gets the timestamp of a date, or gets a timestamp of a time. strtotime resolves a date-time description of any English text to a UNIX timestamp [converts system time to UNIX
In PHP I want to get a timestamp there are many ways, the most common is to use the time function and the strtotime () function to convert the date into a timestamp, I would like to share the time stamp function strtotime usage.
gets the specified
There is a function called Strtotime in PHP. Strtotime implementation: Gets the timestamp of a date, or gets the timestamp of a time. Strtotime to parse the datetime description of any English text into a UNIX timestamp [convert system time to UNIX
Gets the specified year date into the timestamp:
PHP timestamp function gets the UNIX timestamp strtotime of the specified date (' 2012-12-7 ')
Examples are as follows:
The code is as follows
Copy Code
/*Convert Day date to time stampStrtotime (time,now) parameter descriptionTime to specify the string to parse.Now is the time stamp used to calculate the return value. If this argument is omitted, the current time is used.Echo Strtotime ("Now"),
The Strtotime () function in PHP parses the datetime description of any English text into a Unix timestamp, a function that we often use, and a friend to refer to.
GrammarStrtotime (time,now) parameter descriptionTIME specifies a string of times to
In
PHPThere is a name in
StrtotimeThe function. Strtotime implementation: Gets the timestamp of a date, or gets the timestamp of a time. Strtotime to parse the datetime description of any English text into a UNIX timestamp [convert system time to
How to use Strtotime function in PHP
There is a function called Strtotime in PHP. Strtotime implementation: Gets the timestamp of a date, or gets the timestamp of a time. Strtotime to parse the datetime description of any English text
This article introduces to you about PHP in the time function strtotime () function of the principle of explanation, there is a certain reference value, the need for friends can refer to, I hope to help you.
Often people are strtotime combined -1
Use PHP's Strtotime () function sparingly, phpstrtotime function
We in the daily business, for the volume of business, often using the database by time to do horizontal sub-table, the query after the table will often involve time issues. For
In the following article we will give you a detailed description of the PHP strtotime function related usage. This function for beginners is still unfamiliar, I hope that the content described in this article can help us improve the
Implementation:
Today, I saw a small case on weibo. The command line is as follows: The code is as follows:Copy code Php-r "echo date ('Y/M', strtotime ('-2 months'). \" \ n \";" The output result is as follows:2013/03If you change the command line to the
SyntaxStrtotime (time, now) parameter descriptionTime specifies the time string to be parsed.Now is used to calculate the timestamp of the returned value. If this parameter is omitted, the current time is used.Example The code is as follows:Copy
When we use PHP to get the last MONTH, we usually use strtotime (-1 MONTH), but sometimes this will be inaccurate, such as today is, strtotime (-1 MONTH) the result is February 2013, instead of the expected date of January 1,. The preliminary
One, gets the UNIX timestamp for the specified date
Strtotime ("2009-1-22") examples are as follows:
1.echo strtotime ("2009-1-22")
Results: 1232553600
Description: Return January 22, 2009 0:0 0 seconds timestamp
Second, get the English text date
Powerful time conversion functions of php, strtotime function of php
You can use strtotime to convert time strings of various formats into timestamps.
Convert regular time format
echo date('Y-m-d H:i:s', strtotime('2016-01-30 18:00')).PHP_EOL;echo
This article introduces the use of the time function strtotime in PHP, introduces some specific examples to help everyone understand, there is a need for friends to refer to the next.The function of the Strtotime function in PHP: Gets the timestamp
This article mainly introduces the usage of strtotime function in php, and analyzes the parameter meaning and corresponding usage of strtotime function in instance form in detail, which is suitable for time format conversion, for more information
One, gets the UNIX timestamp for the specified date
Strtotime ("2009-1-22") examples are as follows:
1.echo strtotime ("2009-1-22")
Results: 1232553600Description: Return January 22, 2009 0:0 0 seconds timestampSecond, get the English text date
One, gets the UNIX timestamp for the specified dateStrtotime ("2009-1-22") examples are as follows:
1.echo strtotime ("2009-1-22")
Results: 1232553600
Description: Return January 22, 2009 0:0 0 seconds timestamp
two, get English text date
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.