Thread: Date & Datetime problems

Date & Datetime problems

From
Constantine Manoussakis
Date:
Hi there folks,
I am a new user with Linux and Postgres, and I am investigating the
possibilities of using Postgres as my main dB for Data Acquisition
applications over a network. I would like the following help (if
possible):

1) A good reference book for ecpg & libpq
2) what the format of the date & datetime fields must be i.e. if I
create a table such as 'create table daten(date1 date, date2
datetime)' what is the format of the date and a=date time. I have
tried all of the formats mentioned in the .html Programmers manuals,
but none seem to work.

Thank for the help!






_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com


Re: [GENERAL] Date & Datetime problems

From
Oleg Broytmann
Date:
Hello!

On Wed, 16 Dec 1998, Constantine Manoussakis wrote:
> 2) what the format of the date & datetime fields must be i.e. if I
> create a table such as 'create table daten(date1 date, date2
> datetime)' what is the format of the date and a=date time. I have
> tried all of the formats mentioned in the .html Programmers manuals,
> but none seem to work.

t=> create table daten (d date, dt datetime);
CREATE
test=> insert into daten values ('1998-12-01', '1998-12-01 11:45');
INSERT 68042 1
test=> insert into daten values ('1998 Dec 01', '21:14 01 Dec 1998');
INSERT 68043 1
test=> select * from daten;
         d|dt
----------+----------------------------
01-12-1998|Tue 01 Dec 11:45:00 1998 MSK
01-12-1998|Tue 01 Dec 21:14:00 1998 MSK
(2 rows)

Oleg.
----
    Oleg Broytmann  National Research Surgery Centre  http://sun.med.ru/~phd/
           Programmers don't die, they just GOSUB without RETURN.