In the process of migrating from my existing method for handling time zones to the new Rails 2.1 system, I discovered that by default it only applies to datetime and timestamp columns, and not time columns. I''m not sure if this behavior is by design, but I would like to propose that it be changed to include time columns for time zone conversion as well. The reasoning behind this is the same as for datetime and timestamp, even though time columns do not include date information: all times need to appear in the user''s time zone. An example of where this would be important could be a news application that requires the submission of all prospective news items for the next day by a certain time, which is stored in the database. This time, even though it is date agnostic, still needs to appear in the user''s own time zone to be understood correctly. Adding support for this behavior would only require adding :time to the array of valid column types in the ActiveRecord::AttributeMethods::ClassMethods.create_time_zone_conversion_attribute? method. I have submitted a ticket for this issue to lighthouse at http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/839 Is there an issue here that I have overlooked as to why time columns are not currently included? -Connor --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
S. Brent Faulkner
2008-Aug-15 11:40 UTC
Re: Rails 2.1 timezone support doesn''t work with time columns
> Is there an issue here that I have overlooked as to why time columns > are not currently included?Without a date there is no way to know whether or not daylight savings time applies, so there could only be a oneway conversion from local time to UTC during data entry. I guess the assumption could be made that a time field always represented a time on the current date, but this is not going to always be correct. This is my guess as to the original reasoning... I could be completely wrong. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---