hi guys can i insert this
date_default_timezone_set(Asia/Hong_Kong);
$date = date('"m/d/Y H:i:s"');
instead of
"INSERT INTO date_time(`submitted_time`) VALUES (NOW())"
because my problem is using NOW()
or CURRENT_TIMESTAMP()
gives me a inaccurate time
im doing this but when i look at the database this is what is been inserted 0000-00-00 00:00:00.0
date_default_timezone_set('Asia/Manila');
if(isset($_POST['submit'])) {
$date = date('"m/d/Y H:i:s"');
$query = "INSERT INTO `date_time`(`submitted_time`)
VALUES('$date')";
if($conn->query($query)) {
echo "success";
} else {
echo "error";
}
}