开发者

PHP Date difference (calendar control -> conversion in days)

开发者 https://www.devze.com 2023-03-26 10:40 出处:网络
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).

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, otherwi开发者_如何学Cse it's X Days.

Could anybody provide a solution please?


See the doc for DateTime::diff / date_diff there is example too.

0

精彩评论

暂无评论...
验证码 换一张
取 消