FreshPorts -- The Place For Ports If you buy from Amazon USA, please support us by using this link.
Follow us

We also have a status page:

Website Feedback
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Previous Message  |  Next Message 
 Re: Timezones
Author: Dan 
Date:   17-11-04 03:26

Dan wrote:

> I think I may leave the server in PST but change the database
> field to be without a timezone. The input data is already in
> UTC, so all I need to do is strip away the timezone and we're
> done.

I also think I've figured out how to do the conversion.

There are 16 columns to be modified thusly:

dan=# create table a (a timestamp with time zone);
dan=# insert into a values (current_timestamp);
INSERT 46177520 1
dan=# select * from a;
2004-11-16 22:10:08.824097-05
(1 row)

dan=# update a set a = a at time zone 'utc';
dan=# select * from a;
2004-11-17 03:10:08.824097-05
(1 row)


Here, you can see that the time has changed from being -05 (EST) to being UTC (please ignore the -05). Now, we dump the database, alter the 16 columns to be 'timestamp without time zone'. When the data is reimported, the time zone will be dropped, and we'll have this data:

dan=# select * from a;
2004-11-17 03:10:08.824097
(1 row)

That's the theory.

 Reply To This Message  |  Forum List  |  Flat View   Newer Topic  |  Older Topic 

 Topics Author  Date
 Timezones   new
andy 21-05-03 09:32 
 Re: Timezones   new
JunkMale 21-05-03 11:10 
 Re: Timezones   new
andy 22-05-03 06:48 
 Re: Timezones   new
andy 22-05-03 06:52 
 Re: Timezones   new
JunkMale 22-05-03 10:51 
 Re: Timezones   new
AnotherJunkMale 14-11-04 06:15 
 Re: Timezones   new
Dan 14-11-04 13:43 
 Re: Timezones   new
AnotherJunkMale 14-11-04 19:51 
 Re: Timezones   new
Dan 14-11-04 21:01 
 Re: Timezones   new
Dan 16-11-04 23:38 
 Re: Timezones   new
Dan 17-11-04 00:57 
 Re: Timezones   new
Dan 17-11-04 03:26 

 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Remember my login:
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.

Servers and bandwidth provided by
New York Internet, SuperNews, and RootBSD
Valid HTML, CSS, and RSS.
Copyright © 2000-2017 Dan Langille. All rights reserved.