Received: from bologna.nettuno.it (bologna.nettuno.it [193.43.2.1]) by hub.org (8.8.8/8.8.8) with ESMTP id JAA12013 for ; Thu, 17 Sep 1998 09:58:45 -0400 (EDT) (envelope-from jose@sferacarta.com) Received: from proxy.sferacarta.com (mail@sfcabop1.nettuno.it [193.207.10.213]) by bologna.nettuno.it (8.8.6/8.8.6/NETTuno 3.1) with ESMTP id PAA03015; Thu, 17 Sep 1998 15:58:37 +0200 (MDT) Received: from rosso.sferacarta.com (sferacarta.com) [10.20.30.5] by proxy.sferacarta.com with esmtp (Exim 1.92 #1 (Debian)) id 0zJfvb-0005aK-00; Thu, 17 Sep 1998 15:25:03 +0000 Message-ID: <36010E88.AD85EA1A@sferacarta.com> Date: Thu, 17 Sep 1998 15:28:40 +0200 From: "Jose' Soares" X-Mailer: Mozilla 4.05 [en] (Win95; I) MIME-Version: 1.0 To: Henrik Denseje Pedersen CC: pgsql-sql@postgresql.org Subject: Re: [SQL] Datetime field References: <3600DAA3D3.371DHENRIKP@mail.ikasths.dk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 1. If you define it as TIMESTAMP instead of DATETIME you have the format as you desire. 2. If you set DateStyle TO 'ISO', you may have the same result. Take a look: prova=> create table tbl ("Time Stamp" timestamp, "Date Time" datetime); CREATE prova=> insert into tbl values (current_timestamp, 'now'); INSERT 82754 1 prova=> \x turned on expanded table representation prova=> set datestyle to 'POSTGRES'; SET VARIABLE prova=> select * from tbl; Field | Value -- RECORD 0 -- Time Stamp| 1998-09-17 17:19:48+02 Date Time | Thu 17 Sep 17:19:48 1998 CEST (1 row) prova=> set datestyle to 'ISO'; SET VARIABLE prova=> select * from tbl; Field | Value -- RECORD 0 -- Time Stamp| 1998-09-17 17:19:48+02 Date Time | 1998-09-17 17:19:48+02 (1 row) I hope this help you Jose' Henrik Denseje Pedersen wrote: > > Hi all... > > In a database i have created a datetime field.. its works fine, but is > there someway i can get the result back in "normal" date format > instead of this "Wed Aug 19 00:00:00 1998 MET DST". > > I need to use it in my program, so i need it in the normal datetime format: > wich is : 08-19-98 00:00:00 > > By the way, im programming in Perl, so if anyone know a funktion to > convert it back, that could be helpfull too > > Yours Sincerely > > Henrik Pedersen > --