Received: from www-uk-05.digiserve.com ([195.97.231.11]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f2V94RK34303 for ; Sat, 31 Mar 2001 04:04:35 -0500 (EST) (envelope-from dev@archonet.com) Received: from mainbox.archonet.com (mwynhau.demon.co.uk [193.237.186.96]) by www-uk-05.digiserve.com (8.9.1/8.9.1) with ESMTP id KAA11997; Sat, 31 Mar 2001 10:05:19 +0100 (BST) Received: from archonet.com (ibook.archonet.com [192.168.1.32]) by mainbox.archonet.com (Postfix) with ESMTP id A64E02A3AD; Sat, 31 Mar 2001 08:36:15 +0100 (BST) Message-ID: <3AC588C7.9210F3AC@archonet.com> Date: Sat, 31 Mar 2001 08:35:35 +0100 From: Richard Huxton X-Mailer: Mozilla 4.7C-CCK-MCD {C-UDP; EBM-APPLE} (Macintosh; I; PPC) X-Accept-Language: en MIME-Version: 1.0 To: salva@ronincoders.com Cc: pgsql-sql@postgresql.org Subject: Re: date_part bug? References: <3AC1C27D.4D64E67E@yahoo.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200103/656 X-Sequence-Number: 2335 "Salvador Mainé" wrote: > > Hello: > > I'm using postgres 7.0.2. When I use date_part('day', date) sometimes I > get wrong values. Ie: > and date_part('day', '1999-3-28')=27 > > and date_part('day', '2000-3-26')=25 > > Is it a bug? Is there any SQL equivalent function? I remember some issues with summertime settings and timezones (I think the person how originally found the bug was in New Zealand and PG got confused by a +13 timezone) - don't know if this might affect you or if it was fixed before 7.0.2 You might want to try the to_char function and see if that displays the same problem. - Richard Huxton