dbTalk Databases Forums  

[BUGS] BUG #1058: unexpected output when using timezone() and to_char()

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1058: unexpected output when using timezone() and to_char() in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
PostgreSQL Bugs List
 
Posts: n/a

Default [BUGS] BUG #1058: unexpected output when using timezone() and to_char() - 01-21-2004 , 09:46 AM







The following bug has been logged online:

Bug reference: 1058
Logged by: Blake Crosby

Email address: bcrosby (AT) nm (DOT) cbc.ca

PostgreSQL version: 7.3.2

Operating system: FreeBSD 5.1-RELEASE-p11

Description: unexpected output when using timezone() and to_char()

Details:

select to_char(CURRENT_TIMESTAMP,'Day Mon DD YYYY HH24:MI:SS TZ');

returns:

to_char
------------------------------------
Wednesday Jan 21 2004 10:02:11 EST


however,

select to_char(timezone('PST',CURRENT_TIMESTAMP),' Day Mon DD YYYY
HH24:MI:SS TZ');

returns:

to_char
----------------------------------
Wednesday Jan 21 2004 07:07:44


Notice the Time zone field (specified by 'TZ' in the to_char) is missing
from the output.


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #1058: unexpected output when using timezone() and to_char() - 01-21-2004 , 11:43 AM






"PostgreSQL Bugs List" <pgsql-bugs (AT) postgresql (DOT) org> writes:
Quote:
however,
select to_char(timezone('PST',CURRENT_TIMESTAMP),' Day Mon DD YYYY
HH24:MI:SS TZ');
returns:

Wednesday Jan 21 2004 07:07:44

Notice the Time zone field (specified by 'TZ' in the to_char) is missing
from the output.
This isn't a bug. The timezone() function returns datatype timestamp
without time zone, so there is nothing that to_char could usefully
print.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.