Typhoon101
04-16-2005, 03:26 AM
Hi. I have been trying to do this myself for a little while, but have not had any sort of success. I am not too familiar with date functions in PHP yet.
I have a database, that contains two date/time fields. The format for each date is YYYY-MM-DD h:m:s. e.g. 2005-04-16 09:17.
What i need to do is calculate the difference between these two values in hours, rounded up to the nearest whole hour.
So, if $startDate = 2005-04-16 09:17 and $endDate = 2005-04-17 09:27, the result would be 25 hours, even though the actual difference is 24 hours and 10 minutes.
Can anyone help?
I have a database, that contains two date/time fields. The format for each date is YYYY-MM-DD h:m:s. e.g. 2005-04-16 09:17.
What i need to do is calculate the difference between these two values in hours, rounded up to the nearest whole hour.
So, if $startDate = 2005-04-16 09:17 and $endDate = 2005-04-17 09:27, the result would be 25 hours, even though the actual difference is 24 hours and 10 minutes.
Can anyone help?