This works...
mysqli_query
($con, "
INSERT INTO myDB (id, name, mydate)
VALUES ('$id', '$name', now())
")
This doesn't work....
mysqli_query
($con, "
INSERT INTO myDB (id, name, mydate)
VALUES ('$id', '$name', date('Y-m-d H:i:s', strtotime('+5 hour')))
")
The mydate
column in MySQL is of datetime
format.
Any ideas why it's not working? I'm currently using now()
, but I want it to show the time in my timezone, not the server's timezone.