Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL update datetime field

Tags:

database

mysql

I have the following query that is executing successfully, but it is NOT updating the record. Departure_Date2 and Arrival_Date2 are datetime fields. I can't for the life of me figure out why? I've tried with a dash and a forwardslash and still nothing.

UPDATE table SET 
Departure_Date2 =  '22/Nov/15 17:37',
Arrival_Date2 =  '22/Nov/15 19:20' 
WHERE PK =131500
like image 258
Rocco The Taco Avatar asked Dec 05 '22 18:12

Rocco The Taco


1 Answers

A datetime data type has the following format: YYYY-MM-DD HH:MM:SS

For example, 3:30 in the afternoon on December 30th, 1973 would be stored as 1973-12-30 15:30:00.

like image 179
Khamar Uz Zama Avatar answered Dec 16 '22 10:12

Khamar Uz Zama