Обсуждение: bug with >to_char('2007-12-31'::DATE, 'YYYYIW')<

Поиск
Список
Период
Сортировка

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

От
Daniel Schuchardt
Дата:
LOLL2=# SELECT  to_char('2007-12-31'::DATE, 'YYYYIW');
 to_char
---------
 200701
(1 row)


2007-12-31 should be week 2008-01

regards,

    Daniel.

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

От
Tom Lane
Дата:
Daniel Schuchardt <daniel_schuchardt@web.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