I needed to convert a database from SQL to MySQL and did so successfully, however, this question is more geared towards MySQL now.
I noticed that I'm able to insert DateTime
strings into a Timestamp
column type, and that's all fine and good, from what I hear about Timestamp accepting either DateTime or actual Timestamps, however, I'm curious about the "ON UPDATE CURRENT_TIMESTAMP"
now since I have it on a column of the database, since it is only capable of being used on Timestamp
types. Would this use a timestamp that is not in the format: YYYY-MM-DD HH:MM:SS
when it updates based on CURRENT_TIMESTAMP
?
How would this influence the data that I pull from this column exactly?
For Example, would it be difficult to get the current date/time from the TIMESTAMP column when some dates might be a numeric timestamp, while others might be in DATETIME format? Should I just use DATETIME as the type for this column without the ON_UPDATE
ability to avoid a problem with mixed data coming from the database here?