# Database timezone difference

**URL:** <https://www.ruby-forum.com/t/database-timezone-difference/52186>\
**Category:** Ruby\
**Created:** [January 11, 2006, 8:16pm UTC](https://www.ruby-forum.com/t/database-timezone-difference/52186 "2006-01-11T20:16:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![samckayak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@samckayak](https://www.ruby-forum.com/u/samckayak)\
**Post date:** [January 11, 2006, 8:16pm UTC](https://www.ruby-forum.com/t/database-timezone-difference/52186/1 "2006-01-11T20:16:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![samckayak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@samckayak](https://www.ruby-forum.com/u/samckayak)\
**Post date:** [January 11, 2006, 10:52pm UTC](https://www.ruby-forum.com/t/database-timezone-difference/52186/2 "2006-01-11T22:52:12Z")

</div>

On Jan 11, 2006, at 11:15 AM, Sam Dela C. 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 H. - removed\_email\_address@domain.invalid - [http://segment7.net](http://segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)

---

<div class="post-metadata">

**Author:** ![samckayak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@samckayak](https://www.ruby-forum.com/u/samckayak)\
**Post date:** [January 12, 2006, 12:16pm UTC](https://www.ruby-forum.com/t/database-timezone-difference/52186/3 "2006-01-12T12:16:34Z")

</div>

Eric H. 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
```
