pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #12367: Wrong result on to_char() when inputing dates
2+ messages / 2 participants
[nested] [flat]

* BUG #12367: Wrong result on to_char() when inputing dates
@ 2014-12-29 03:12  Israelins85@yahoo.com.br
  0 siblings, 1 reply; 2+ messages in thread

From: Israelins85@yahoo.com.br @ 2014-12-29 03:12 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      12367
Logged by:          Israel
Email address:      Israelins85@yahoo.com.br
PostgreSQL version: 9.3.5
Operating system:   MacOs/Windows/Linux
Description:        

this select shows the diference:

SELECT 
to_char(('2014-12-28 22:01:39.151-03' AT TIME ZONE 'UTC'),
'IYYY-MM-DD"T"HH24:MI:SS.MS"Z"'), 
to_char(('2014-12-28 22:01:39.151-03' AT TIME ZONE 'UTC'),
'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"')


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #12367: Wrong result on to_char() when inputing dates
@ 2014-12-29 14:55  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Israelins85@yahoo.com.br
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2014-12-29 14:55 UTC (permalink / raw)
  To: Israelins85@yahoo.com.br; +Cc: pgsql-bugs

Israelins85@yahoo.com.br writes:
> this select shows the diference:

> SELECT 
> to_char(('2014-12-28 22:01:39.151-03' AT TIME ZONE 'UTC'),
> 'IYYY-MM-DD"T"HH24:MI:SS.MS"Z"'), 
> to_char(('2014-12-28 22:01:39.151-03' AT TIME ZONE 'UTC'),
> 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"')

The results look correct to me: today is the first day of ISO year
2015.  See
http://en.wikipedia.org/wiki/ISO_week_date

The construction IYYY-MM-DD basically never makes any sense.  You
should use IYYY with IDDD and/or IW.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2014-12-29 14:55 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-12-29 03:12 BUG #12367: Wrong result on to_char() when inputing dates Israelins85@yahoo.com.br
2014-12-29 14:55 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox