From: Robert Buck Date: 2012-12-11T10:13:28+09:00 Subject: Re: Time.new(2001, 12, 3).to_i returns wrong value Yes, the big problem here is that, since what I am writing is a database driver, users can throw anything at me. So I have no control over how the Time/Date objects are created. But at the database interface I need to normalize, for both inserts and queries. Since the internal database API assumes those date/times that are passed as millis since the epoch are UTC, I do that conversion explicitly using offsets. For string representations during inserts I provide my own quote_date function in the AR Adapter. On the return route I have resorted to always providing Date/Time in local timezone, applying the opposite adjustment described above. -- Posted via http://www.ruby-forum.com/.