Re: Date Anomaly??

From: Thomas Good <tomg(at)sqlclinic(dot)net>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Ian Barwick <barwick(at)gmx(dot)net>, Postgres SQL List <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Date Anomaly??
Date: 2003-05-07 16:02:16
Message-ID: Pine.LNX.4.44.0305071157450.32335-100000@q8.nrnet.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sqlclinic(dot)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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-05-07 16:13:05 Re: Date Anomaly??
Previous Message mdc 2003-05-07 15:56:09 help database corruption