On Wed, 24 Apr 2002, Cosmin wrote:
> How can I compare time? So I have to check a difference of 12 or 24 hours
> this mean I have to compare the time between the days too..
> 
> How I can make this comparing
> just comparing hour with hou and then minute with minute or is possible
> all of them at the same time?

As long as you don't care about any units larger than days (months and 
years are variable-length and thus a little more work), you can just 
calculate the difference between two unix timestamps. They're just an 
integer number of seconds. Subtract the two, divide by 60 for minutes, 
3600 for hours, or 86400 for days.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to