Topic: SQL Date is for Date.today as SQL Datetime is for ...
I have a table of versions (id, version, realease_date).
Originally, the release_date field was a Date on my database but I've changed it to Datetime.
To automatically create a Date (so the user wouldn't have to when creating a new version) I added:
@version.release_date = Date.today
What is the equivalent of the above now that I'm dealing with Datetime?
I've tried @version.release_date = DateTime.now but that gave me the following error:
Mysql::Error: #22007Incorrect datetime value: '2006-11-23T16:15:13Z' for column 'release_date' at row 1:
(Which I can plainly see is wrong, because of the T and Z that appeared...)
Thank you for your help,