Re: format date retrieved from database - Mailing list pgsql-php

From Michael Fork
Subject Re: format date retrieved from database
Date
Msg-id Pine.BSI.4.21.0103231538020.21785-100000@glass.toledolink.com
Whole thread Raw
In response to format date retrieved from database  (Naomi Fullam <fullam@student.cs.ucc.ie>)
List 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
>


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)




pgsql-php by date:

Previous
From: Naomi Fullam
Date:
Subject: format date retrieved from database
Next
From: Paul Joseph McGee
Date:
Subject: Input Forms