This article gives a detailed analysis of how to use PHP to calculate the year, month, week, and number of days between two dates, for more information, see use PHP to calculate the year, month, week, and number of days between two dates:
The code
/**
* Calculates the year, month, week, and day of two date intervals
* Edit bbs.it-home.org
*/
function format ($a, $b) {
Check the two date size, the default is small after large, if the former large after the small swap
This article introduces how to use the date and strtotime functions in php to obtain the first day or the last day of the document given by the user. if you need to learn more, you can refer to it. By using the date and strtotime functions, you can
The current time is increased by one day: ecchodate (Y-m-d, strtotime (+ 1day) the current time is increased by January: strtotime (+ 1 month) the current time is increased by one year: strtotime (+ 1 year) current time increase by one second:
You may have some idea of the time stamp, so how do we apply it to get a specific date? Let us introduce you to the specific ways PHP timestamps get the current period.
Implementation: Gets the timestamp of a date, or gets the PHP timestamp for a
You may have some knowledge of PHP timestamps, so how do we apply it to get a specific date? Let us introduce you to the specific ways PHP timestamps get the current period.
Implementation: Gets the timestamp of a date, or gets the PHP timestamp
PHP timestamp Format all summary (get time, timestamp), PHP
There are many kinds of functions in the PHP language, different ways of application, and the functions of implementation are not the same. Hope to learn from the novice to help!
One, the
There are many kinds of functions in the PHP language, different application methods, the implementation of the function is not the same. Hope to be helpful to the Novice's study!
First, the PHP timestamp function gets the UNIX timestamp strtotime (
You may have some knowledge of the PHP timestamp , so how do we apply it to get a specific date? Today we're going to introduce you to the specifics of how php timestamp gets the current period.
Implementation function: Gets the timestamp of a
This article introduces you to the use of the date and Strtotime function in PHP to get the user a given time of the first day or the last day of the article, there is a need to understand learning friends can enter the reference.
With the date and
Php calculates the number of days between two dates. This article will introduce to you in detail the example of the number of days between two dates calculated by php. for your reference, we generally use strtotime to convert the date and then
One, the PHP timestamp function gets the UNIX timestamp of the specified date Strtotime ("2009-1-22″) example is as follows:
Echo strtotime ("2009-1-22″) Results: 1232553600
Description: Return January 22, 2009 0:0 0 seconds timestamp
Second, the
Date converted to timestampPHP provides functions that can easily convert various forms of a date to a timestamp, which is mainly:
Strtotime (): Resolves the datetime description of any English text to a timestamp.
Mktime (): Gets the
1.PHP Timestamp function converts a date to a Unix timestamp
World End Time Stamp PHP
The code is as follows
echo "World Doomsday Timestamp:". Strtotime ("2012-12-21")
2. Convert time stamp to system time
There is a problem with time calculation... list the last 6 months & lt ;? $ Arrarray (); $ nowddate (& quot; Ym & quot;); $ arr [] date (& quot; Ym & quot;, strtotime (& quot; -6 month & quot;); $ arr [] date (& quot; Ym & quot;, strtotime time
With the date and strtotime functions, you can easily obtain the first and last days of the current month, next month, and last month. The following describes their implementation. The date format of the function is yyyy-MM-dd. 1. Given a date, get
Timestamp is a small feature that we often use in comparison of time and date, next, I will introduce some methods for converting the strtotime Timestamp and use it to format a date several minutes, several hours ago, or several days ago. Timestamp
There is a problem with time calculation... list the last 6 months & lt ;? $ Arrarray (); $ nowddate (& quot; Ym & quot;); $ arr [] date (& quot; Ym & quot;, strtotime (& quot; -6 month & quot;); $ arr [] date (& quot; Ym & quot;, strtotime time
PHP timestamp function. 1. the PHP timestamp function converts a date to a unix Timestamp. The PHP code is as follows echo :. strtotime (2012-12-21) 2. convert the timestamp to system Time 1. the PHP timestamp function converts a date to a unix
Date_default_timezone_set (' Asia/shanghai '); Setting the time zone
One, format time function date, return string
@params
String Date (String param1,intparam1,inttime)
1.date functions (vs. printf, sprintf functions)
Date (' Time format ' [, '
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.