Re: Day of week question

From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: "PostgreSQL Hacker" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Day of week question
Date: 2003-10-05 12:03:27
Message-ID: 000b01c38b38$b0472d70$6401a8c0@DUNSLANE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Looks like it is caused by the switch to the Gregorian calendar in 1752,
when 11 days were chopped out of September ( in England and America -
elsewhere anywhere between Oct 1582 and early 20th century). A quick scan of
the code didn't show postgres taking account of this oddity, but I might
have missed something.

cheers

andrew

----- Original Message -----
From: "Michael Meskes" <meskes(at)postgresql(dot)org>
To: "PostgreSQL Hacker" <pgsql-hackers(at)postgresql(dot)org>
Sent: Sunday, October 05, 2003 7:06 AM
Subject: [HACKERS] Day of week question

> Do to a bug in pgtypeslin I've been experimenting with the day of week
> stuff a little bit and I found that we do not agree with the output of
> the cal command on older dates. I have no idea which one is correct:
>
> mm=# select to_char('1000/01/01'::date,'D');
> to_char
> ---------
> 4
> (1 row)
>
> Thus we believe 1000/1/1 is a Wednesday. cal says:
>
> Januar 1000
> So Mo Di Mi Do Fr Sa
> 1 2 3 4 5 6
> 7 8 9 10 11 12 13
> 14 15 16 17 18 19 20
> 21 22 23 24 25 26 27
> 28 29 30 31
>
> Thus 1000/1/1 is a Monday. Is this a bug in cal? Or do we produce the
> wrong output? Or do I simply misread the output?
>
> Michael
> --
> Michael Meskes
> Email: Michael at Fam-Meskes dot De
> ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes(at)jabber(dot)org
> Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-10-05 13:34:54 Re: Open 7.4 items
Previous Message Peter Eisentraut 2003-10-05 11:59:26 Re: Day of week question