I have been trying to get this code working for about half an hour and for the life of me, I can't. I've been able to echo the time, but when I try implementing it into my PHP parser, it just returns all 0's. I've tried many different ways, but the code only reflects one way I've tried.
date_default_timezone_set('America/Los_Angeles');
$date = date("m/d/Y h:i:s a", time());
$dbh = new PDO('mysql:host=localhost;dbname=x', 'x', 'x');
$dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $dbh->prepare("INSERT INTO zzz (x, x1, x2, reply_date) VALUES (:x, :x1, :x2, :date1)");
$stmt->bindParam(':x', $_POST['yyy']);
$stmt->bindParam(':x1', $_POST['qqq']);
$stmt->bindParam(':x2', $_POST['ppp']);
$stmt->bindParam(':date1', $date);
$stmt->execute();