dimanche 14 mars 2021

Laravel : Invalid datetime format: 1292 Incorrect datetime value: '2021-03-14 02:00:00'

i received a lots of invalid datetime format errors

[2021-03-14 02:00:00] production.ERROR: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2021-03-14 02:00:00' for column `xxxxxxx`.`users`.`last_activity` at row 1 (SQL: update `users` set `last_activity` = 2021-03-14 02:00:00, `users`.`updated_at` = 2021-03-14 02:00:00 where `id` = 2561) {"userId":2561,"exception":"[object] (Illuminate\\Database\\QueryException(code: 22007): SQLSTATE[22007]:
[stacktrace]


[2021-03-14 02:58:46] production.ERROR: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2021-03-14 02:58:46' for column `xxxx`.`posts`.`updated_at` at row 1 (SQL: update `posts` set `view` = `view` + 1, `posts`.`updated_at` = 2021-03-14 02:58:46 where `id` = 43018) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 22007): SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2021-03-14 02:58:46' for column `xxxx`.`posts`.`updated_at` at row 1 (SQL: update `posts` set `view` = `view` + 1, `posts`.`updated_at` = 2021-03-14 02:58:46 where `id` = 43018) at /home/xxxx/xxxxx/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664, PDOException(code: 22007): SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2021-03-14 02:58:46' for column `xxxx`.`posts`.`updated_at` at row 1 at /home/xxxx/xxxx/vendor/laravel/framework/src/Illuminate/Database/Connection.php:483)
[stacktrace]

The errors started at: 2021-03-14 02:00:00

And ended at: 2021-03-14 02:58:46

Everything worked fine for over a year

All is back to normal without any code change.

Can someone help me understand what's happening?

config/app.php :

  1. 'timezone' => 'Africa/Tunis',

Table structure :

enter image description here Database server :

  • Server: Localhost via UNIX socket
  • Server type: MariaDB
  • Server connection: SSL is not being used Documentation
  • Server version: 10.3.27-MariaDB-log-cll-lve - MariaDB Server
  • Protocol version: 10
  • User: xxx@localhost
  • Server charset: cp1252 West European (latin1)


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3vkzHZb
via IFTTT

1 commentaire:

  1. Same thing happened me. It was caused by daylight savings in the USA - 02:00 to 02:59 on the 14th March is an invalid time stamp.

    RépondreSupprimer