Strtotime keeps returning false on MySql timestamp

Associate
Joined
19 Jun 2006
Posts
162
Location
Swansea, Wales
I posted this on devshed but it seems no-one is there tonight. should have learnt by now to always stick with the tried and tested ocuk :p

After reading plenty of different sites I can't seem to come up with a solution for my problem. My code...

Code:
 $ts = strtotime("Y-m-d H:i:s", $row["timestamp"]);

if ($ts == false || $ts === "-1") {
  echo "Invalid timestamp.";
}
                
$date = date("d m Y", $ts);
$time = date("H:i", $ts);

The database row is definitly in the "Timestamp" format and when i view it in phpMyadmin I see a date like: "2007-05-12 22:25:55"

I don't see the problem! Help!
 
Back
Top Bottom