PHP Date difference (calendar control -> conversion in days)
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.
精彩评论