# Strategy for handling historical dates while avoiding timezones

**URL:** <https://www.ruby-forum.com/t/strategy-for-handling-historical-dates-while-avoiding-timezones/166448>\
**Category:** Rails\
**Created:** [April 25, 2009, 11:52am UTC](https://www.ruby-forum.com/t/strategy-for-handling-historical-dates-while-avoiding-timezones/166448 "2009-04-25T11:52:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [April 25, 2009, 11:52am UTC](https://www.ruby-forum.com/t/strategy-for-handling-historical-dates-while-avoiding-timezones/166448/1 "2009-04-25T11:52:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [April 25, 2009, 12:03pm UTC](https://www.ruby-forum.com/t/strategy-for-handling-historical-dates-while-avoiding-timezones/166448/2 "2009-04-25T12:03:55Z")

</div>

On Apr 25, 1:27 am, david [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [April 25, 2009, 1:44pm UTC](https://www.ruby-forum.com/t/strategy-for-handling-historical-dates-while-avoiding-timezones/166448/3 "2009-04-25T13:44:04Z")

</div>

> 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
