BUG #16192: Function to_char(date,'IW') return incorrect value for last days of a year

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: olivier(dot)delemar(at)free(dot)fr
Subject: BUG #16192: Function to_char(date,'IW') return incorrect value for last days of a year
Date: 2020-01-06 08:39:39
Message-ID: 16192-0a7c830763891773@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16192
Logged by: Olivier Delemar
Email address: olivier(dot)delemar(at)free(dot)fr
PostgreSQL version: 9.6.6
Operating system: Linux
Description:

According to ISO 8691 specifications, the first week of a year is the week
containing the first thursday of the year. Thus, the 30 and 31 of december
2019 should be in the first week of 2020, but "to_char" set them in the
first week of... 2019!

[postgres] $ psql
psql (9.6.6)
Saisissez « help » pour l'aide.

# select to_char('2019-12-30'::date, 'YYYY-IW');
to_char
---------
2019-01
(1 ligne)

Temps : 152,799 ms

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas Kellerer 2020-01-06 09:12:06 Re: BUG #16192: Function to_char(date,'IW') return incorrect value for last days of a year
Previous Message Fabien COELHO 2020-01-06 07:47:34 Re: BUG #16186: The usage of undefined value in pgbench.c