Re: convert from an integer to a date

From: miquels(at)cistron-office(dot)nl (Miquel van Smoorenburg)
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: convert from an integer to a date
Date: 2003-02-17 19:52:08
Message-ID: b2reh8$a30$1@news.cistron.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

In article <OFC94B0A45(dot)89F8C8AE-ON85256CCD(dot)0075A6DD(at)jc(dot)jefco(dot)com>,
<STashlitsky(at)JEFCO(dot)com> wrote:
>How can I convert from integer into date format correctly?

traffic=# select date(20030212);
date
------------
2003-02-12
(1 row)

or

traffic=# select 20030212::text::date;
date
------------
2003-02-12
(1 row)

Mike.
--
Anyone who is capable of getting themselves made President should
on no account be allowed to do the job -- Douglas Adams.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Mintoo Lall 2003-02-17 20:07:13 Returning multiple rows from plpgsql function
Previous Message Josh Berkus 2003-02-17 19:52:01 Re: PL/PGSQL EDITOR