I am currently trying to calculate the date difference with a PHP Script. The days are in a calendar control, while the time is in 2 dropboxes (hour/minute).
You can see my demo form here .
I need the PHP script to return the date in days, using the following formula. If the difference between the dates is > X days and more than 2 hours , then the difference is X+1 days, otherwise it's X Days.
Could anybody provide a solution please?
参见文档中有关DateTime :: diff / date_diff的示例。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.