Mysql – Why can’t I insert this value using timestamp but can with datetime

datetimeMySQLtimestamp

I want to insert this value: 2020-03-29 01:00:00

If I set up a column called date with data type datetime I can insert the value. But if I use the data type timestamp I cannot insert and get an error message:

Incorrect datetime value: '2020-03-29 01:00:00' for column 'date' at row 1

Furthermore, if I insert 2020-03-29 02:00:00 using data type timestamp it works… seriously, what is going on here?

I am using the GMT timezone. I'm creating a 2020 calendar table where I want to insert every hour in a year. Should I skip that time?

Best Answer

This is because of the daylight time-saving change. You're trying to insert an unexisting timeframe, so we can call it the daylight saving gap.

Solution: Just skip that specific time in your table.