david
2009-Apr-25 00:27 UTC
Strategy for handling historical dates while avoiding timezones
Currently using t.datetime, dates get stored with a timezone and a non- zero time. This is bad. A date restricted to the Unix epoch is unacceptable. The date range must be at least back to 1800. Need a recommendation on what SQL column type, Rails column type and Ruby object type would be the best choice, and how to avoid timezones.
Frederick Cheung
2009-Apr-25 10:03 UTC
Re: Strategy for handling historical dates while avoiding timezones
On Apr 25, 1:27 am, david <da...-cm7vr8cjTZ9BDgjK7y7TUQ@public.gmane.org> wrote:> Currently using t.datetime, dates get stored with a timezone and a non- > zero time. This is bad. > > A date restricted to the Unix epoch is unacceptable. The date range > must be at least back to 1800. > > Need a recommendation on what SQL column type, Rails column type and > Ruby object type would be the best choice, and how to avoid timezones.an sql DATE column (which maps to the ruby Date type) would seem to fit. You''ve got several thousand years of range, no timezone problems since it''s a pure calendar day type. Fred
david
2009-Apr-25 11:43 UTC
Re: Strategy for handling historical dates while avoiding timezones
> an sql DATE column (which maps to the ruby Date type) would seem to > fit. You''ve got several thousand years of range, no timezone problems > since it''s a pure calendar day type.Yes, indeed, that solves my problem. Ta very much. Just didn''t know where to look. 90% of my problems with Ruby/Rails eventually translate into: "Where is the documentation/source code for the thing that does X?" If I had a general solution to THAT problem, life would be sweet. David