469,579 Members | 1,221 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,579 developers. It's quick & easy.

Time zone string not showing

Hi all,

I want to have the time zone string (like 'BRT') displayed after a
date-time. The date column is of the type timestamp with time zone. But
the time zone is not displayed.

It works for a timestamp without time zone column:
# select to_char(timestamp '2001-02-16 20:38:40' at time zone 'BRT',
'HH24:MI DD/MM/YYYY TZ');
to_char
----------------------
23:38 16/02/2001 UTC

It does not work for a timestamp with time zone column:
# select to_char(timestamp with time zone '2001-02-16 20:38:40-05' at
time zone 'BRT', 'HH24:MI DD/MM/YYYY TZ');
to_char
-------------------
22:38 16/02/2001

Is it the expected behavior? Should I just append the time zone
string? The problem is it could be 'BRT' or 'BRST' depending on the
date.

Regards,
Clodoaldo Pinto

__________________________________________________ _____
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade!
http://br.acesso.yahoo.com/

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #1
1 2129
=?iso-8859-1?q?Clodoaldo=20Pinto=20Neto?= <cl*************@yahoo.com.br> writes:
It does not work for a timestamp with time zone column:
# select to_char(timestamp with time zone '2001-02-16 20:38:40-05' at
time zone 'BRT', 'HH24:MI DD/MM/YYYY TZ');
to_char
-------------------
22:38 16/02/2001 Is it the expected behavior?


Yes. AT TIME ZONE converts a timestamp without time zone to a timestamp
with time zone, or vice versa.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jonatan Fernstad | last post: by
7 posts views Thread by WindAndWaves | last post: by
1 post views Thread by heirou | last post: by
3 posts views Thread by Jon Davis | last post: by
3 posts views Thread by Satish Itty | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.