Yes I had a look at mktime() and date() and tried to think of an easy 
way to do it but couldn't... you can convert both dates to a UNIX 
timestamp (millseconds after whatever date) then do a subtraction... and 
then what? Easy to work out number of days from millseconds as a day's 
length is fixed but to go to months is harder as of course you need more 
information than just the actual elapsed time. Similar problam with 
mktime() as it's designed for actual dates, not differences between days.

What is XEmacs calc- mode and calendar mode? I'm not all that familiar 
with Unix I'm afraid..

Thanks for your reply!
Julian

[EMAIL PROTECTED] wrote:

> On Sun, Feb 18, 2001 at 04:40:08PM -0700, Julian Rockeu wrote:
> 
>> Anyone know how to use the PHP date functions to work out the difference 
>> between two timestamps?
>> 
>> For example..
>> 
>> Figure out the number of seconds, minutes, hours, days, months and years 
>> between
>> 
>> 5th October 2001 14:20:10
>> and
>> 26th February 1998 109:54:10
> 
> 
> This should be doable with http://php.net/mktime and http://php.net/date. But
> for such heavy calculations I prefer XEmacs calc-mode or the calendarr-mode. 
> 
> -Egon
> 


-- 
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