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
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 example, we would like to query a user's order for 1 months from the
First look at the manual introduction:
strtotime-resolves a date-time description of any English text to a Unix timestamp
Format: int strtotime (string $time [, int $now])
This function expects to accept a string containing the U.S. English date
Definition and usage
The strtotime () function parses the date and time descriptions of any English text into UNIX timestamps.Syntax
Strtotime (time, now)
Parameters
Description
Time
Specifies the time string to be
The strtotime function has a strange problem.
Var_dump (strtotime ('20140901'); // output bool (false) var_dump (strtotime ('20160901'); // output int (1441185010)
It's strange, why are the two results different?
Reply to discussion (solution)
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
BenArticleFromHttp://wordpress.org/support/topic/php-530-amp-wp-28-it-is-not-safe-to-rely-on-the-systems-timezone
Warning: strtotime () [function. strtotime]: it is not safe to rely on the system's timezone settings. you are * required * to use the
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
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
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
Usage Analysis of the strtotime function in PHP, phpstrtotime
This article describes the use of the time addition and subtraction function strtotime in PHP. We will share this with you for your reference. The details are as follows:
Time addition
In front of the
In this article, we mention that the Strtotime function will have some status when using Strtotime ("-1 month") for one months today.
Therefore also leads to write this article, this article includes the following content:
Some
We mention that the Strtotime function is going to be a bit of a situation when we use Strtotime ("-1 month") for one months today.
This article also leads to writing this article, which includes the following: some usages of the strtotime function
I encountered a particularly strange problem, using post to get a table only son pass the data, and assign it to a variable, this variable is just acquired with echo printing is no problem, can be displayed normally. But in the process of function
The PHP strtotime function resolves the date-time description of any English text to a UNIX timestamp [converts system time to UNIX timestamp]
First, get the Unix timestamp strtotime ("2009-1-22″" example) for the specified date as follows:
Echo
[PHP] Basic (date function and strtotime function)-Tao Shihan date (): format a local time or date. The current time is 15:19:49, January 1, May 13, 2016.
Use the date () function to output the day of the current month. parameter: String Type
[PHP] Return to the basics (date and strtotime functions), datestrtotime
Date (): format a local time or date. The current time is 15:19:49, January 1, May 13, 2016.
Use the date () function to output the day of the current month. Parameter:
Comparison between PHP and Java learning Date and Time Functions, phpjava date functions
Let's talk about PHP first.
Date ():Format a local time or date. The current time is 15:19:49, January 1, May 13, 2016.
Use the date () function to output the
In front of the
In the article, we mentioned that the Strtotime function is going to be a bit of a situation when you use Strtotime ("-1 month") for one months today.
So it also leads to writing this article, which includes the following:
some
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.