Processing dates in PHP is very inconvenient, such as asking for a difference between the two dates of the month? What should we do?
FileName: date.inc.php3
Before you use these two functions, you must first convert the date or datetime to the timestamp type.
Such as:
$today =mktime (0,0,0,date ("M"), Date ("D"), Date ("Y"));
/**** simulate the DATEADD function in SQL Server *******
$part Type: string
Value range: year,month,day,hour,min,sec
Which part of the date to increase
$n Type: Numeric value
said: To increase how much, according to $part decide which part to add
Can be a negative number
$datetime Type: Timestamp
Indicated: increased cardinality
return type: Timestamp
/**** simulate the DATEDIFF function in SQL Server *******
$part Type: string
Value range: year,month,day,hour,min,sec
Which part of the date to increase
$date 1, $date 2 type: Timestamp
Indicates: two dates to compare
Return type: Numeric value
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.