Re: format date retrieved from database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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@xxxxxxxxxxxxxx)





[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux