I was using int
type for storing datetime type data. For the convenience of getting the data in specific range from MySQL, I tried changing it to TIMESTAMP/DATETIME
but it is giving the error as in the attached image in both the cases. The format for datatype TIMESTAMP/DATETIME
is YYYY-MM-DD HH:MM:SS
which is 19 character long.
I could not get a proper tutorial/article to get knowledge about this error/issue.
YYYY-MM-DD HH:MM:SS
. Thanks for pointing out this cruicial point regarding this datatype although I have gone through articles in dev.mysql.com.