When i Create table with Month he only given 0000-00-00

CREATE TABLE hour ( Name1 varchar(25) not null,
                    Datee DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
                    Monthh TINYINT NOT NULL DEFAULT (MONTH(CURRENT_TIMESTAMP))
                  );

fiddle

PS. HOUR is Reserved word – I’d recommend to rename a table.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top