Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f15FC3x15638 for ; Mon, 5 Feb 2001 10:12:03 -0500 (EST) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0TITqq19830 for ; Mon, 29 Jan 2001 13:29:52 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f0TI2MK78998 for pgsql-sql@postgresql.org; Mon, 29 Jan 2001 13:02:22 -0500 (EST) (envelope-from news) From: Keith Perry X-Newsgroups: comp.databases.postgresql.sql Subject: Problem with Day of Week Date: Mon, 29 Jan 2001 12:55:24 -0500 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 44 Message-ID: <3A75AE8C.3E6D7F53@vcsn.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.76 [en] (Win95; U) X-Accept-Language: en To: pgsql-sql@postgresql.org X-Archive-Number: 200102/44 X-Sequence-Number: 1214 Greetings, I notice some talk about date problems and interestingly enough planning out an application in which I will need to be able to manipulate dates. I notice however that there seems to be a discrepancy with the day or week in 7.0.3 --- pmhcc=# select date_part('dow','now'::timestamp); date_part ----------- 1 (1 row) pmhcc=# select to_char('now'::timestamp,'D'); to_char --------- 2 (1 row) pmhcc=# select version(); version --------------------------------------------------------------------- PostgreSQL 7.0.3 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66 (1 row) pmhcc=# select now(); now ------------------------ 2001-01-29 12:57:46-05 (1 row) --- Now as far as I know, Sunday is supposed to 1, so I would think that date_part is doing something funky unless I am mis-understanding something. I was hoping that someone might be able to shead some light on this. Thanks. Keith C. Perry VCSN, Inc. http://vcsn.com