Re: BUG #12367: Wrong result on to_char() when inputing dates

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Israelins85(at)yahoo(dot)com(dot)br
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #12367: Wrong result on to_char() when inputing dates
Date: 2014-12-29 14:55:42
Message-ID: 5680.1419864942@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Israelins85(at)yahoo(dot)com(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2014-12-29 15:09:09 Re: BUG #12330: ACID is broken for unique constraints
Previous Message Merlin Moncure 2014-12-29 14:47:35 Re: BUG #12330: ACID is broken for unique constraints