[PHP] Re: Date comparison going wrong, wrong, wrong

2012-11-11 Thread Maciek Sokolewicz
On 11-11-2012 22:47, Jim Giner wrote: Besides the minor fact that the code has syntax errors, the problem with it is your if is backwrads. The facts are: today is less than end date, so your if should show "The show has ended" since you are asking if today IS GREATER than the end date. BTW - th

[PHP] Re: Date comparison going wrong, wrong, wrong

2012-11-11 Thread Jim Giner
BTW - this is the code I used to test out your process: $showenddate) echo "The date of the show has not yet arrived"; else echo "The show has ended"; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Date comparison going wrong, wrong, wrong

2012-11-11 Thread Jim Giner
On 11/11/2012 1:30 PM, Terry Ally (Gmail) wrote: Hi all, I am having a problem with comparing time. I am using the following: $todaydate = date("D, M jS, Y g:i:s a"); $showenddate = date("D, M jS, Y g:i:s a", strtotime($showsRecord['end_date'])); if ($todaydate > $showenddate): echo "The

[PHP] Re: Date comparison

2004-02-04 Thread Michael Nolan
Burhan Khalid wrote: BEOI 7308 wrote: Hi I want to substract $first_date to $second_date and print the result this way : xx days, xx hours, xx minutes i tried (strtotime($second_date)-strtotime($first_date)) but what i get is a timestamp and i dont know what to do with it Is there already a