On 4 Aug 2009, at 13:09, Der Tung wrote:
> But know I have two Users A and B in different timezones.
> When A saves a timestamp I want B to:
> - Get the timestamp displayed in his timezone
> - Get the timestamp displayed in the timezone a originally
> saved it in
>
> Does the type “timestamp with time zone” contain the original
> timezone or at least the offset to UTC it was saved in, or does it
> just save the UTC time?
>
> If it saves the timezone/offset, how can I access it?
No it doesn't, but if you store User A's timestamp as both a timestamp
with time zone and as timestamp witout time zone you should get just
the values you're looking for.
=> select cast(now() at time zone 'CEST' as timestamp without time
zone) at time zone 'GMT';
timezone
-------------------------------
2009-08-06 14:15:07.444748+02
(1 row)
=> select cast(now() at time zone 'CEST' as timestamp with time zone)
at time zone 'GMT';
timezone
---------------------------
2009-08-06 10:15:12.66097
(1 row)
Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.
!DSPAM:737,4a7aadf610131061822158!