Re: DateTime fields

From: "Dale Anderson" <danderso(at)crystalsugar(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: DateTime fields
Date: 2000-06-27 12:51:23
Message-ID: s9585d07.000@crystalsugar.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Here is am example of what I am doing.....

danderso=# \d test
Table "test"
Attribute | Type | Modifier
-----------+-----------+----------
time | timestamp |

danderso=# insert into test values (to_timestamp('1200 PM JUN 27 2000','HHMI PM MON DD YYYY'));
INSERT 22825 1
danderso=# select * from test;
time
------------------------
2000-06-28 00:00:00-05
(1 row)

danderso=#

Thanks,
Dale.

>>> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 06/26/00 05:41PM >>>
"Dale Anderson" <danderso(at)crystalsugar(dot)com> writes:
> I noticed that the DateTime fields and the to_timestamp function
> interpret 12 PM as 00:00 and 12 AM as 12:00.

Huh?

regression=# select '2000-06-12 12:00 am' ::datetime;
?column?
------------------------
2000-06-12 00:00:00-04
(1 row)

regression=# select '2000-06-12 12:00 pm' ::datetime;
?column?
------------------------
2000-06-12 12:00:00-04
(1 row)

Looks fine to me.
Could you be more precise about what you're trying to do?

regards, tom lane

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Louis-David Mitterrand 2000-06-27 13:10:41 BLOB DBI func() interface under postgres
Previous Message Poul L. Christiansen 2000-06-27 12:41:40 Re: How to dump from Postgre