It's important to note that datetime has a range of 1000-9999, but the range for timestamp is only 1970-2038.
this can be a problem if your system has to store birthdates, or you
have to handle something like the payment plan for a 30-year mortgage.
In version 5.6.5, it is possible to set a default value on a datetime
column, and even make a column that will update when the row is
updated. The type definition:
CREATE TABLE foo ( creation_time DATETIME DEFAULT CURRENT_TIMESTAMP, modification_time DATETIME ON UPDATE CURRENT_TIMESTAMP )
|
0 comments:
Post a Comment