Forum: Ruby on Rails Strategy for handling historical dates while avoiding timezones

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B382cd51abbda449f289ddae3819ef2c?d=identicon&s=25 david (Guest)
on 2009-04-25 11:52
(Received via mailing list)
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.
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-04-25 12:03
(Received via mailing list)
On Apr 25, 1:27 am, david <da...@yorkage.com> 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
B382cd51abbda449f289ddae3819ef2c?d=identicon&s=25 david (Guest)
on 2009-04-25 13:44
(Received via mailing list)
> 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
This topic is locked and can not be replied to.