"Seader, Cameron" <CSeader(at)idahopower(dot)com> writes:
> When i insert data into the timestamptz field it is automatically adding on
> the time zone of MST which is not correct. The data that is being inserted
> is not MST it is GMT. how do i make it insert as GMT.
You can either SET TIMEZONE TO 'GMT' or explicitly specify -00 in the
input data. If you want it to come back out in GMT then you will
definitely need to set the timezone value.
Realize that what is stored in the database is GMT in any case. If you
enter a timestamp that doesn't mention any particular zone, then it is
assumed to be in the zone specified by the timezone variable. In either
case, a non-GMT timestamp is then adjusted to GMT for storage. When the
value is displayed, it is adjusted back to the zone currently selected
by the timezone variable (which might or might not be the same as the
zone it was originally entered in). A little experimentation with
changing timezone and seeing how entry and output are affected should
make this clearer.
regards, tom lane
In response to
pgsql-novice by date
|Next:||From: Noel||Date: 2004-01-20 01:24:47|
|Subject: long deletes :( Pls help|
|Previous:||From: Seader, Cameron||Date: 2004-01-19 22:35:15|
|Subject: timestamptz insert|