Re: DateTime fields - Mailing list pgsql-general

From Dale Anderson
Subject Re: DateTime fields
Date
Msg-id s9585d07.000@crystalsugar.com
Whole thread Raw
In response to DateTime fields  ("Dale Anderson" <danderso@crystalsugar.com>)
Responses Re: DateTime fields  (Karel Zak <zakkr@zf.jcu.cz>)
List 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@sss.pgh.pa.us> 06/26/00 05:41PM >>>
"Dale Anderson" <danderso@crystalsugar.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


pgsql-general by date:

Previous
From: mikeo
Date:
Subject: trigger question
Next
From: Louis-David Mitterrand
Date:
Subject: BLOB DBI func() interface under postgres