Re: select to_char(current_timestamp, 'YYYY-WW'); - Mailing list pgsql-general

From Tom Lane
Subject Re: select to_char(current_timestamp, 'YYYY-WW');
Date
Msg-id 7610.1288916503@sss.pgh.pa.us
Whole thread Raw
In response to select to_char(current_timestamp, 'YYYY-WW');  (Alexander Farber <alexander.farber@gmail.com>)
Responses Re: select to_char(current_timestamp, 'YYYY-WW');  (Alexander Farber <alexander.farber@gmail.com>)
List pgsql-general
Alexander Farber <alexander.farber@gmail.com> writes:
> sorry for the stupid question, but why has the week number changed
> from 44 to 45 this night?

WW is defined as starting the first week on the first day of the year.
2010 started on a Friday so the week number increments on Fridays.

There are some other format codes with different behavior ...

            regards, tom lane

pgsql-general by date:

Previous
From: Alexander Farber
Date:
Subject: select to_char(current_timestamp, 'YYYY-WW');
Next
From: "Carlo Stonebanks"
Date:
Subject: How do you control IMMUTABLE PG PROC results?