Rails automatically appends a dummy date when you use the TIME type on
your database. My point is: if you are using a time data type on your
database, you are doing that exactly because you don't want the date
Anyway, I am storing a integer column with the total seconds on the
database and then transforming that with composed_of. Is there a
better way to do that? Anyone know if there is a gem or something to
handle cases like these?
Time without data is useless and extremely prone to error. Internally
time is stored as millisecond offsets from a reference date (e.g. UNIX
time is the number of milliseconds from midnight January 1, 1970 UTC).
The date and time related objects in Ruby depend on this underlying
a value of 14:00 is meaningless without relating that to some date, in
some time zone, and applying the geopolitical rules for daylight savings
(or other adjustments to the normal flow of time).
I personally don't know why MySQL even bothers providing a TIME field
Of course, as always, I could be missing some specific use case for it.