pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedformat date retrieved from database
2+ messages / 2 participants
[nested] [flat]
* format date retrieved from database
@ 2001-03-23 20:30 Naomi Fullam <fullam@student.cs.ucc.ie>
0 siblings, 1 reply; 2+ messages in thread
From: Naomi Fullam @ 2001-03-23 20:30 UTC (permalink / raw)
To: pgsql-php
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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: format date retrieved from database
@ 2001-03-23 20:42 Michael Fork <mfork@toledolink.com>
parent: Naomi Fullam <fullam@student.cs.ucc.ie>
0 siblings, 0 replies; 2+ messages in thread
From: Michael Fork @ 2001-03-23 20:42 UTC (permalink / raw)
To: Naomi Fullam <fullam@student.cs.ucc.ie>; +Cc: 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
>
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-03-23 20:42 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-03-23 20:30 format date retrieved from database Naomi Fullam <fullam@student.cs.ucc.ie>
2001-03-23 20:42 ` Michael Fork <mfork@toledolink.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox