sorry i'm newbie in date/time in php, i would like to ask if this is correct script or not,if not can u help me improving this script.
<?php
$date1 = date('m-d-Y H:i:s a');
$date2 = "09-17-2011 11:51:21 am";
if($date1>=$date2){
echo "bad";
}else{
echo "good";
}
but when i change the year of $date2 to 2010 so it means the output should be bad because the $date1>=$date but when i try to run the script output still the same which is "good".someone help me should be appreciated..n thanks n advance.
?>