Re: Date Formatting - Mailing list pgsql-novice

From Doug Silver
Subject Re: Date Formatting
Date
Msg-id Pine.LNX.4.21.0205031353290.4244-100000@danzig.sd.quantified.net
Whole thread Raw
In response to Date Formatting  (Tom Ansley <tansley@law.du.edu>)
Responses Re: Date Formatting  ("Joel Burton" <joel@joelburton.com>)
List pgsql-novice
Hi Tom -

select cast (now() as date) as date;
    date
------------
 2002-05-03

Depending on your application (e.g. perl/php script), that output is easy
enough change it around to what you want or you could certainly write a
function to do it -- something I have yet to do!  I think such a function
would be fairly easy to do since you're just rearranging the
output, but doesn't everything look easy at the outset?  You didn't
mention the context of what you need this for, so there are lots of ways
to do this.

-doug

On Fri, 3 May 2002, Tom Ansley wrote:

> I am writing timestamps to file and the formatting is currently 2002-06-06
> 00:00:00.0.  Is there a function to only write the date and also to format it
> something like MM/dd/yyyy   ?
>
> Thanks
>
> Tom
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Doug Silver
Network Manager
Urchin Corporation    http://www.urchin.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


pgsql-novice by date:

Previous
From: Masaru Sugawara
Date:
Subject: Re: Transaction Question
Next
From: "Kristian Skrede Gleditsch"
Date:
Subject: