RE: [PHP] compare dates

2011-12-01 Thread Marc Fromm
Thanks. I'm stuck using 5.1.6. Matijn reply worked by using the unix timestamp. -Original Message- From: Maciek Sokolewicz [mailto:tula...@gmail.com] On Behalf Of Maciek Sokolewicz Sent: Thursday, December 01, 2011 12:57 PM To: Marc Fromm Cc: Floyd Resler Subject: Re: [PHP] compare

Re: [PHP] compare dates

2011-12-01 Thread Maciek Sokolewicz
On 01-12-2011 02:17, Floyd Resler wrote: On Nov 30, 2011, at 5:04 PM, Matijn Woudt wrote: On Wed, Nov 30, 2011 at 11:00 PM, Marc Fromm wrote: I'm puzzled why the if statement executes as true when the first date (job_closedate) is not less than the second date (now). The if statement claims

Re: [PHP] compare dates

2011-12-01 Thread Maciek Sokolewicz
On 01-12-2011 02:17, Floyd Resler wrote: On Nov 30, 2011, at 5:04 PM, Matijn Woudt wrote: On Wed, Nov 30, 2011 at 11:00 PM, Marc Fromm wrote: I'm puzzled why the if statement executes as true when the first date (job_closedate) is not less than the second date (now). The if statement claims

Re: [PHP] compare dates

2011-12-01 Thread Maciek Sokolewicz
On 01-12-2011 02:17, Floyd Resler wrote: On Nov 30, 2011, at 5:04 PM, Matijn Woudt wrote: On Wed, Nov 30, 2011 at 11:00 PM, Marc Fromm wrote: I'm puzzled why the if statement executes as true when the first date (job_closedate) is not less than the second date (now). The if statement claims

Re: [PHP] compare dates

2011-11-30 Thread Floyd Resler
On Nov 30, 2011, at 5:04 PM, Matijn Woudt wrote: > On Wed, Nov 30, 2011 at 11:00 PM, Marc Fromm wrote: >> I'm puzzled why the if statement executes as true when the first date >> (job_closedate) is not less than the second date (now). >> The if statement claims that "12/02/2011" is less than "1

Re: [PHP] compare dates

2011-11-30 Thread Matijn Woudt
On Wed, Nov 30, 2011 at 11:00 PM, Marc Fromm wrote: > I'm puzzled why the if statement executes as true when the first date > (job_closedate) is not less than the second date (now). > The if statement claims that "12/02/2011" is less than "11/30/2011". > >                if (date("m/d/Y",strtotim

[PHP] compare dates

2011-11-30 Thread Marc Fromm
I'm puzzled why the if statement executes as true when the first date (job_closedate) is not less than the second date (now). The if statement claims that "12/02/2011" is less than "11/30/2011". if (date("m/d/Y",strtotime($jobs_closedate)) <= date("m/d/Y",strtotime("now"))){

Re: [PHP] Compare dates

2003-09-29 Thread Leif K-Brooks
Shaun wrote: How can I compare two dates with PHP, to see if one date occurred before the other? Convert them to a timestamps (strtotime()), then just compare them: $date1 = 'september 10th 2003'; $date2 = 'september 20th 2003'; $date1_ts = strtotime($date1); $date2_ts = strtotime($date2); if(

Re: [PHP] Compare dates

2003-09-29 Thread Blue Prawn
> How can I compare two dates with PHP, to see if one date occurred before > the other? probably not the best way but: if the date is formated like this 20030929 (today) 20030928 (yesterday) I think it is quite easy: if ( (int)$today > (int)$yesterday ) or perhaps like this: if ( strcmp($today, $

RE: [PHP] Compare dates

2003-09-29 Thread chris . neale
Sent: 29 September 2003 10:52 To: [EMAIL PROTECTED] Subject: [PHP] Compare dates Hi, How can I compare two dates with PHP, to see if one date occurred before the other? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php If you

[PHP] Compare dates

2003-09-29 Thread Shaun
Hi, How can I compare two dates with PHP, to see if one date occurred before the other? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Compare dates

2003-06-05 Thread Shaun
Hi, I have two dates retrieved from a database stored as variables: $mindate and $maxdate, how can i compare the two with PHP so i can loop and increment i.e. while($mindate < $maxdate){ //do some stuff $mindate++; } Thanks for your help -- PHP General Mailing List (http://www.php.net/)