I've been battling time since trying to use Sequel with Oracle and I think I finally found the issue. The ruby-oci8 gem handles all the ruby date / time creation from the database. Thus I think Sequel simply uses whatever the adapter returns. The problem is nothing you set in Sequel will affect what oci8 does. I was setting Sequel.default_timezone=:utc and expecting to get back UTC times but was always getting back local timezone times. I tracked this down to how oci8 is creating the times and it is using the Oracle session timezone. Thus to get it to return UTC times I had to do the following:
DB.run "ALTER SESSION SET TIME_ZONE='-00:00'" Now all accesses from the DB instance return times with that timezone and everything works! I'd like to see this incorporated into Sequel such that setting Sequel.default_timezone does this. Obviously this is Oracle specific and when I looked at timezones.rb I didn't see anything specific to an adapter. Let me know the best way to make this patch and I'll be happy to implement and test it. Thanks, Jason -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
