Re: bug with >to_char('2007-12-31'::DATE, 'YYYYIW')<

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Schuchardt <daniel_schuchardt(at)web(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: bug with >to_char('2007-12-31'::DATE, 'YYYYIW')<
Date: 2007-12-05 03:37:58
Message-ID: 11309.1196825878@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Daniel Schuchardt <daniel_schuchardt(at)web(dot)de> writes:
> LOLL2=# SELECT to_char('2007-12-31'::DATE, 'YYYYIW');
> to_char
> ---------
> 200701
> (1 row)

> 2007-12-31 should be week 2008-01

No, it shouldn't. YYYY is defined to deliver calendar year.
For ISO year use IYYY.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-12-05 03:46:37 Re: Transaction isolation and constraints
Previous Message lighthouse.software 2007-12-05 03:37:39 Re: ldap authentication allows logon with blank password