ober Posted July 10, 2022 Share Posted July 10, 2022 I am converting a site to MySQL 8 and PHP 8.1 (from MySQL 5.7 and PHP 7.4). I have a number of datetime fields in the database and when I try to update one of them, I am getting the error: Quote PDOException: SQLSTATE: Invalid datetime format: 1292 Incorrect datetime value: '2022-07-09 21:02:04 EDT' The code I am using is this: $this->userobj->uaction = date("Y-m-d H:i:s"); If I output that code to the error log I get the date fully as expected. But for some reason, MySQL is getting it with the timezone attached. I'm about to pull my hair out because I cannot figure out how that's getting changed between me setting the value and MySQL processing it. Does anyone know why this might be happening? Some kind of automatic formatting in MySQL? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.