Re: formatting a date
От | Zak McGregor |
---|---|
Тема | Re: formatting a date |
Дата | |
Msg-id | 20010510224627.54704fe5.zak@mighty.co.za обсуждение исходный текст |
Ответ на | formatting a date (Fran Fabrizio <ffabrizio@Exchange.WebMD.net>) |
Ответы |
Re: formatting a date
|
Список | pgsql-general |
On Thu, 10 May 2001 15:30:01 -0400 Fran Fabrizio <ffabrizio@Exchange.WebMD.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. ====================================================================
В списке pgsql-general по дате отправления: