![]() |
Date and time.. Yikes
PHP Code:
|
Quote:
For example: PHP Code:
Quote:
PHP Code:
Quote:
strtotime function (much like you can with taking time away, as in the previous example).PHP Code:
|
I get it for the most part... But, the time, if you use
getdate($difference) $getdate[hours]; like I did above, it gives the hour difference in the day. Not the total number of hours between the two times. And how would I make this happen in real time? |
umm...the number of seconds between 2 dates / the number of seconds in an hour (3600) should give you the difference in hours.
|
OHHH!!!
I totally didn't read Salathe's first paragraph. Is there a reference to all the seconds in a day/month and such, or do I need to do a lot of math? |
You'll have to perform the calculations yourself...but why do you think it's such a pain? It's simple math. Check this out:
PHP Code:
|
Thank you, that really cleared it up for me.
What is \ why did you use the Ciel() function? |
The ceil function is used to round up a floating point number. (ex: ceil(1.79) = 2). Of course, you may want to use floor (to round down a number - floor(1.79) = 1), which is more appropriate than ceil in cases like this one, because 67 minutes means 1 hour and 7 minutes, not 2 hours. But you will have to decide for yourself what you need.
|
| All times are GMT. The time now is 10:24 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0