pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Monscheuer <mm@digiperience.de>
To: pgsql-bugs@postgresql.org
Subject: Year 2024: Extracting week from date gives wrong results for the last two days of the year
Date: Wed, 4 Jul 2018 15:55:54 +0200
Message-ID: <018392b4-52b1-5166-0c71-6bf09c65d530@digiperience.de> (raw)

Team,

Extracting the week from a date gives wrong results for the last two days of 2024.

SELECT EXTRACT (WEEK FROM DATE '20241230');

or

SELECT EXTRACT (WEEK FROM DATE '20241231');

both result in a value of  1
which is wrong, obviously...

The expected result is 53

The results for the year 2020 are correct:
SELECT EXTRACT (WEEK FROM DATE '20201230');
results to 53

Version:
PostgreSQL 10.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9), 64-bit
on Amazon RDS

Greetings from Hamburg, DE

MiMo





view thread (5+ messages)  latest in thread

Message-ID: <018392b4-52b1-5166-0c71-6bf09c65d530@digiperience.de>
Permalink:  ../018392b4-52b1-5166-0c71-6bf09c65d530@digiperience.de/
Also on:    postgresql.org/message-id/018392b4-52b1-5166-0c71-6bf09c65d530@digiperience.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: mm@digiperience.de
  Subject: Re: Year 2024: Extracting week from date gives wrong results for the last two days of the year
  In-Reply-To: <018392b4-52b1-5166-0c71-6bf09c65d530@digiperience.de>
  References: <018392b4-52b1-5166-0c71-6bf09c65d530@digiperience.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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