This is not possibly - do this on $date2 first:

$foo_date2 = str_replace('-',$foo_date2);

then 

if($date1 < $foo_date2)
{

}
else
{

}

--Joe

On Mon, Jan 15, 2001 at 03:15:38PM -0600, Jacky@lilst wrote:
> Hi people,
> I have tried to compare 2 date values to see if one come before another using the 
>sniplet below:
> 
> if ($date1 < $date2) {
> do something
> }else{
> .......
> }
> 
> while $date1 is in "yyyymmdd" format but $date2 is in "yyyy-mm-dd" formate because I 
>get value of $date2 from a "date" data type field from a table. 
> Can I use this "yyyy-mm-dd" to compare with value from another date variabile in the 
>"yyyymmdd" format?  If not possible, How do I make both of them to be in the same 
>format?
> cheers
> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set for yourself"

-- 

Joe Stump, PHP Hacker
[EMAIL PROTECTED]
http://www.miester.org/


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

Reply via email to