> The subject pretty much explains it all.  I have 2 dates (YYYYMMDDHHSS
> format) and want to determine the number of days, hours, minutes and
seconds
> left from the later date to the earlier date.  I figure I could do all
this
> using date arithmatic, divide by 60 seconds in a minute, 60 minutes in an
> hour, 24 hours in a day and so forth, but was wondering if there a better
> (or easier way) to do this before I start coding away.?

If those come from MySQL, use MySQL's date_add function.  Or something like
that...

http://mysql.org/

If they are just from some raw text file...  I'm betting that somebody has
done the subtraction and formatting part for PHP dates, so you just need to
use http://php.net/substr and http://php.net/mktime

Check the code archives linked from http://php.net/links.php for date
algorithms.


By Day:                                |By Night:
    Don't miss the Zend Web Store's    |   There's not enough room here...
    Grand Opening on January 23, 2001! |   Start here:
    http://www.zend.com                |   http://l-i-e.com/artists.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to