From: | Zak McGregor <zak(at)mighty(dot)co(dot)za> |
---|---|
To: | Fran Fabrizio <ffabrizio(at)Exchange(dot)WebMD(dot)net> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: formatting a date |
Date: | 2001-05-10 20:46:27 |
Message-ID: | 20010510224627.54704fe5.zak@mighty.co.za |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Thu, 10 May 2001 15:30:01 -0400
Fran Fabrizio <ffabrizio(at)Exchange(dot)WebMD(dot)net> wrote:
>
> I'm looking all over the place in the Pg docs and Momjian book and
> having no luck finding any functions that would turn a timestamp such as
> 2001-05-08 23:59:59-04 into May 8, 2001. (i.e. do what date_format()
> was doing for me in MySQL.) Is there equivalent functionality in Pg?
>
You want to look at to_char().
To get May 10, 2001 you'd need to write something like:
select to_char(now(), 'Month dd, YYYY');
It pads the output of the month to 9 places, btw.
See
http://postgresql.readysetnet.com/users-lounge/docs/7.1/user/functions-formatting.html
(watch for potential wrapping of the link)
for more info.
--
====================================================================
Zak McGregor
http://www.carfolio.com - Specifications of cars online. Over 7000!
--------------------------------------------------------------------
Of course my password is the same as my pet's name.
My macaw's name was Q47pY!3, but I change it every 90 days.
====================================================================
From | Date | Subject | |
---|---|---|---|
Next Message | Mikheev, Vadim | 2001-05-10 20:57:40 | RE: COPY locking |
Previous Message | Laurent Duperval | 2001-05-10 20:46:18 | How to create a trigger |