Re: select to_char(current_timestamp, 'YYYY-WW');

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: select to_char(current_timestamp, 'YYYY-WW');
Date: 2010-11-05 00:21:43
Message-ID: 7610.1288916503@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alexander Farber <alexander(dot)farber(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Carlo Stonebanks 2010-11-05 00:24:14 How do you control IMMUTABLE PG PROC results?
Previous Message Alexander Farber 2010-11-05 00:15:48 select to_char(current_timestamp, 'YYYY-WW');