Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mibu31's avatar

MySQL date formats

Hi guys,

So I'd like some words of wisdom about MySQL date formats.

I came across a problem this morning where a date on a history timeline wasn't saving correctly and this was because the data type was set to TIMESTAMP and the date in question was before 1970 and therefore causing problems when saving.

I'm using mutators to deal with dates (mainly Carbon) and I fixed the above problem by setting the data type to DATETIME.

I'd really like to know a bit more about the different types and I'd appreciate it if someone could please give an overview as to the pros/cons of each type? Should I have used DATE rather than DATETIME? Are there differences in performance? Does MySQL have more functionality using one over the other? etc.

Thanks for your time, Mike

0 likes
1 reply

Please or to participate in this conversation.