MySQL Forums
Forum List  »  Install & Repo

Re: Zeros in Dates
Posted by: Roberto de Bem
Date: February 11, 2026 10:54AM

Hi Gary,

Actually, MySQL versions 8 and 9 do allow dates as 0, but not by default. Please note that those settings are controlled by the NO_ZERO_IN_DATE and NO_ZERO_DATE options in sql_mode. By default, those are enabled. If you want to be able to use 0 values on dates, you can do it by removing those from the sql_mode, like below:


MySQL > SET GLOBAL sql_mode = "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION";

Doc links:
https://dev.mysql.com/doc/refman/9.6/en/date-and-time-types.html
https://dev.mysql.com/doc/refman/9.6/en/server-system-variables.html#sysvar_sql_mode



Best,
Beto!

Options: ReplyQuote


Subject
Written By
Posted
November 22, 2025 01:41AM
Re: Zeros in Dates
February 11, 2026 10:54AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.