I am working on a Rails project using a Postgres database. For one of my models, I have a time column, called (cleverly) time. When I created the model, I set the data type for this column as 'time', with the (perhaps incorrect) understanding that this data type was for storing time only, no date.
t.time :time
However, when I submit data to the model, the time is correct but prefixed by an incorrect date:
time: "2000-01-01 16:57:19"
I just want the column to store the time (like '16:57:19'). Is 'time' the correct data type to use? Or is there some other way I should handle this problem?
Thank you very much.
timetype to the Postgres time type. Are you sure you are using postgres and not sqlite for the development environment?