i am using mysql and and php , currently i have date and time in my database but when i get the date using sql , i keep on getting 1970-01-01 no matter what date , but if i try to add still no luck ! can any one guide me
$startDate = $result['startDate'];
$date=date('Y-m-d',$startDate);
echo $date;
it should be something like 01-07-2011 . but it dosn't i have tried strtotime() also . but it dosnt help . can any one help me .
$date = strtotime(date("Y-m-d", strtotime($startDate)) . " +1 day");
echo $date;
answer should be 2011-07-02 but its 1970-01-02
thanks in advance