[PHP-DB] Easy way to calculate difference between two dates

2002-01-20 Thread SpamSucks86

Is there an easy way to calculate the difference between the current
date and a date prior to January 1, 1970 (unix epoch). Just getting the
timestamp and then subtracting the other date from it won't work because
it will be a negative number. Any insight? I think this can be done very
easily in ASP (built in function? But I don't know ASP, it's just what I
heard). Thanks for your help =)



RE: [PHP-DB] Easy way to calculate difference between two dates

2002-01-20 Thread Beau Lebens

soo what happens with php if you do something like convert them both to 

Y-m-d H:i:s

and then subtract one from the other, i have a feeling (haven't tried) that
php will handle the rest for you...

// -Original Message-
// From: SpamSucks86 [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 21 January 2002 10:19 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Easy way to calculate difference between two dates
// 
// 
// Is there an easy way to calculate the difference between the current
// date and a date prior to January 1, 1970 (unix epoch). Just 
// getting the
// timestamp and then subtracting the other date from it won't 
// work because
// it will be a negative number. Any insight? I think this can 
// be done very
// easily in ASP (built in function? But I don't know ASP, it's 
// just what I
// heard). Thanks for your help =)
// 

-- 
PHP Database 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]




Re: [PHP-DB] Easy way to calculate difference between two dates

2002-01-20 Thread Jason Wong

On Monday 21 January 2002 10:19, SpamSucks86 wrote:
 Is there an easy way to calculate the difference between the current
 date and a date prior to January 1, 1970 (unix epoch). Just getting the
 timestamp and then subtracting the other date from it won't work because
 it will be a negative number. Any insight? I think this can be done very
 easily in ASP (built in function? But I don't know ASP, it's just what I
 heard). Thanks for your help =)

Have a look at the chapter on calendar Functions. In particular

juliantojd() 
jdtojulian()

NB they only work for whole days (no H:M:S).

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
His heart was yours from the first moment that you met.
*/

-- 
PHP Database 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]