From: Jose' Soares <jose@sferacarta.com>
To: Henrik Denseje Pedersen <HenrikP@mail.ikasths.dk>
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Datetime field
Date: Thu, 17 Sep 1998 15:28:40 +0200
Message-ID: <36010E88.AD85EA1A@sferacarta.com> (raw)
References: <3600DAA3D3.371DHENRIKP@mail.ikasths.dk>
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
> --
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: jose@sferacarta.com, HenrikP@mail.ikasths.dk
Subject: Re: [SQL] Datetime field
In-Reply-To: <36010E88.AD85EA1A@sferacarta.com>
References: <3600DAA3D3.371DHENRIKP@mail.ikasths.dk> <36010E88.AD85EA1A@sferacarta.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox