Forum: Ruby database timezone difference

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.
E9488ef674513283e2822ba162559131?d=identicon&s=25 Sam Dela Cruz (Guest)
on 2006-01-11 20:16
(Received via mailing list)
Hi,

I'm pulling data from a database in Europe and saving a dataset in North
America database.  Included in the data are DateTime information.
Because
the timezones are different, when I pull the data it gets translated to
local timezone.  Locally, in North America, I need to process reports
based on dates, and I need to have a report exactly as if it came from
European database.  How do I preserve the date in European timezone
before
being uploaded to North American db?

Regards,
Sam
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2006-01-11 22:52
(Received via mailing list)
On Jan 11, 2006, at 11:15 AM, Sam Dela Cruz wrote:

> being uploaded to North American db?
a) store times in UTC
b) use a database that has a column type of "timestamp with time
zone" (Postgres or equivalent).

--
Eric Hodel - drbrain@segment7.net - http://segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com
5befe95e6648daec3dd5728cd36602d0?d=identicon&s=25 Robert Klemme (Guest)
on 2006-01-12 12:16
(Received via mailing list)
Eric Hodel wrote:
>> from European database.  How do I preserve the date in European
>> timezone before
>> being uploaded to North American db?
>
> a) store times in UTC
> b) use a database that has a column type of "timestamp with time
> zone" (Postgres or equivalent).

In Oracle it's called "TIMESTAMP WITH LOCAL TIMEZONE" - values are
converted to the sessions timezone on retrieval.  This is in Oracle 9
and
newer.  Oracle's "Globalization Support Guide" is a good reading on the
matter.

HTH

    robert
This topic is locked and can not be replied to.