Re: [PHP] days between two timestamps

2002-06-05 Thread Tyler Longren
quot;1LT John W. Holmes" <[EMAIL PROTECTED]> To: "Tyler Longren" <[EMAIL PROTECTED]>; "php-general" <[EMAIL PROTECTED]> Sent: Wednesday, June 05, 2002 10:09 AM Subject: Re: [PHP] days between two timestamps > Since those look like MySQL timestamps,

Re: [PHP] days between two timestamps

2002-06-05 Thread Martin Clifford
Well, I had the right idea... John is just more advance than me. :o) >>> "1LT John W. Holmes" <[EMAIL PROTECTED]> 06/05/02 11:09AM >>> Since those look like MySQL timestamps, I would suggest you do it in your query. SELECT TO_DAYS(column1) - TO_DAYS(column2) AS Difference FROM table Adapt to

Re: [PHP] days between two timestamps

2002-06-05 Thread Jason Wong
On Wednesday 05 June 2002 23:01, Tyler Longren wrote: > Hi, > > I have two different timestamps: > 20020603164114 > and > 20020605054710 > > Is there a simple way to get the number of days between the two dates? These look like mysql timestamps. If you're getting them from mysql, you might try a

Re: [PHP] days between two timestamps

2002-06-05 Thread 1LT John W. Holmes
Since those look like MySQL timestamps, I would suggest you do it in your query. SELECT TO_DAYS(column1) - TO_DAYS(column2) AS Difference FROM table Adapt to your needs. Explain what your overall mission is and there is probably a query that'll return just that. If you want to use PHP, format

Re: [PHP] days between two timestamps

2002-06-05 Thread Martin Clifford
Use substr() to extract the appropriate information, then format it and compare it. 20020603 is obviously June 3, 2002 and 20020605 is obviously June 5, 2002 which means there was 1 day (plus x hours) between the two. Hope to help! Martin >>> "Tyler Longren" <[EMAIL PROTECTED]> 06/05/02 11:01