Thanks Jonathan. I removed the date() syntax function and it works.

From: Jonathan Sundquist []
Sent: Thursday, January 03, 2013 2:16 PM
To: Marc Fromm
Cc: Serge Fonville;
Subject: Re: [PHP] date problem


When you take a date and do a strtotime you are converting it to an int which 
you can compare to each other much easier. So for your above example you would 
be best doing.

$jes = 01/03/2012;

if ( strtotime($jes) < strtotime(WSOFFBEGIN) )
        $error = " MUST begin after " . WSOFFBEGIN . "\n";
On Thu, Jan 3, 2013 at 4:12 PM, Marc Fromm 
<<>> wrote:
Thanks for the reply.

Every example on comparing dates in PHP that I found uses the "strtotime" 
function which I am using.  What other type can I use?

When is this example below supposed to work?

// your first date coming from a mysql database (date fields)
$dateA = '2008-03-01 13:34';
// your second date coming from a mysql database (date fields)
$dateB = '2007-04-14 15:23';
if(strtotime<>($dateA) > 
    // bla bla


From: Serge Fonville 
Sent: Thursday, January 03, 2013 2:05 PM
To: Marc Fromm
Subject: Re: [PHP] date problem


date returns a string

You should compare a different type for bigger/smaller than


Kind regards/met vriendelijke groet,

Serge Fonville

Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
2013/1/3 Marc Fromm 
I am comparing to dates.

$jes = 01/03/2012;

if ( date("m/d/Y", strtotime($jes)) < date("m/d/Y", strtotime(WSOFFBEGIN)) )
        $error = " MUST begin after " . WSOFFBEGIN . "\n";

I cannot figure out why the $error is being assigned inside the if statement, 
since the statement should be false. 01/03/2012 is not less than 09/16/2012.


Reply via email to