I have a row in in MySQL database with a DATETIME value of “1934-11-18
10:58:06”, which is outside of range for a Time object. I guess Rails is
smart enough to recognize that fact and therefore pulls that value in as
a DateTime object, as opposed to Time, which it uses for dates after
year of 1969.
Now… when I try to go save that object back into the database, it
gives me the following error:
“ActiveRecord::StatementInvalid: Mysql::Error: Incorrect datetime value:
‘1934-11-18T10:58:06Z’ for column ‘call_date’ at row 1”
It looks like the T and the Z in the date are what is used by default to
format a DateTime object, but MySQL does not seem to appreciate it.
What workaround would you suggest?