From: | jason(dot)servetar(at)ccgenesis(dot)com |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: to_date/to timestamp going to BC |
Date: | 2001-10-03 21:36:31 |
Message-ID: | 309339290B4FD31184BC0060B06888CB01D0FDF4@CADILLAC |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Wednesday, October 03, 2001 3:14 PM
To: Servetar, Jason
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] to_date/to timestamp going to BC
jason(dot)servetar(at)ccgenesis(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Lee Harr | 2001-10-04 00:23:04 | Re: select 5/2??? |
Previous Message | Tom Lane | 2001-10-03 21:14:02 | Re: to_date/to timestamp going to BC |