Re: format date retrieved from database

From: Michael Fork <mfork(at)toledolink(dot)com>
To: Naomi Fullam <fullam(at)student(dot)cs(dot)ucc(dot)ie>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: format date retrieved from database
Date: 2001-03-23 20:42:05
Message-ID: Pine.BSI.4.21.0103231538020.21785-100000@glass.toledolink.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

You want to take a look at the to_char function described here:

http://www.postgresql.org/devel-corner/docs/user/functions-formatting.html

in your case it would be:

SELECT to_char(myDateField, 'DD-MM-YYYY')

Michael Fork - CCNA - MCP - A+
Network Support - Toledo Internet Access - Toledo Ohio

On Fri, 23 Mar 2001, Naomi Fullam wrote:

> Hi
> I found this function for mysql
>
> SELECT DATE_FORMAT(myDateField, '%d-%m-%Y') FROM myTable
>
> The DATE_FORMAT function allows one to format myDateField as I see fit,
> I want to have it in date-month-year format. myDateField is of type
> date.
>
> Basically I was just wondering if there is a similar Postgres command?
>
> Thanks in advance!
>
> Naomi
>

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Paul Joseph McGee 2001-03-25 16:01:10 Input Forms
Previous Message Naomi Fullam 2001-03-23 20:30:27 format date retrieved from database