Received: from cadillac.gaiam.com ([63.74.106.78]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f93La1n22501 for ; Wed, 3 Oct 2001 17:36:03 -0400 (EDT) (envelope-from jason.servetar@ccgenesis.com) Received: by CADILLAC with Internet Mail Service (5.5.2653.19) id ; Wed, 3 Oct 2001 15:36:33 -0600 Message-ID: <309339290B4FD31184BC0060B06888CB01D0FDF4@CADILLAC> From: jason.servetar@ccgenesis.com To: pgsql-sql@postgresql.org Subject: Re: to_date/to timestamp going to BC Date: Wed, 3 Oct 2001 15:36:31 -0600 X-Mailer: Internet Mail Service (5.5.2653.19) X-Archive-Number: 200110/39 X-Sequence-Number: 4994 Thanks Tom that worked great. I guess I should have not skipped the FM prefix section of the date conversion doc. drw_dev-> to_timestamp(dt, 'FMMonth dd, yyyy') from test_date; dt | to_date | to_timestamp ----------------+------------+------------------------ March 11, 1997 | 1997-03-11 | 1997-03-11 00:00:00-07 -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Sent: Wednesday, October 03, 2001 3:14 PM To: Servetar, Jason Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] to_date/to timestamp going to BC jason.servetar@ccgenesis.com writes: > Can someone tell me if this is a bug with the date functions or am I using > them incorrectly? I get the right thing when I use the right format: regression=# select dt, to_timestamp(dt, 'FMMonth dd, yyyy') from test_date; dt | to_timestamp ----------------+------------------------ March 11, 1997 | 1997-03-11 00:00:00-05 (1 row) However, I'd agree that this shows a lack of robustness in to_timestamp; it's not objecting to data that doesn't match the format. regards, tom lane