Re: Date Anomaly?? - Mailing list pgsql-sql

From Thomas Good
Subject Re: Date Anomaly??
Date
Msg-id Pine.LNX.4.44.0305071157450.32335-100000@q8.nrnet.org
Whole thread Raw
In response to Re: Date Anomaly??  (Josh Berkus <josh@agliodbs.com>)
List pgsql-sql
On Wed, 7 May 2003, Josh Berkus wrote:

Hey Josh, how goes?

> > Bottom line: there is no way to return a MM-DD-YYYY value?
>
> Really easy, actually:
> SELECT to_char(datefield, 'MM-DD-YYYY');

Thanks for this (thanks to Bruno and Tom as well!)

This does the trick for me:
SELECT TO_CHAR(CURRENT_DATE - INTERVAL '1 MONTH','MM-DD-YYYY');

> One of the things on my todo list (Item #18, though) is a pl/perl function
> that will accept any reasonable US date and return ISO standard for insert;
> I'll post it to the list when I'm done (maybe next week).

Excellent!

-----------------------------------------------------------------------
Thomas Good                                  e-mail: tomg@sqlclinic.net
Programmer/Analyst                           phone:   (+1) 718.818.5528
Residential Services                         fax:     (+1) 718.818.5056
Behavioral Health Services, SVCMC-NY         mobile:  (+1) 917.282.7359

// Das ist die Kunst - wie man alles verhunzt.



pgsql-sql by date:

Previous
From: mdc@keko.com.ar
Date:
Subject: help database corruption
Next
From: Tom Lane
Date:
Subject: Re: Date Anomaly??