Re: date functions - Mailing list pgsql-general

From Darren Ferguson
Subject Re: date functions
Date
Msg-id Pine.LNX.4.10.10202011121180.9106-100000@thread.crystalballinc.com
Whole thread Raw
In response to date functions  ("Johnson, Shaunn" <SJohnson6@bcbsm.com>)
List pgsql-general
There is a Postgres function called to_char

Example:

SELECT a.tt_id,
       to_char(a.date_time_submitted,CAST('mm/dd/yyyy' AS text)) AS
date_time_submitted
FROM table a
WHERE a.tt_id = id

RESULT: id | 12/31/2001

Look in the format of the function it is in the documentation. The
formatiing will show you other notations this is just one of them that
fitted on of your examples.

Darren Ferguson

On Fri, 1 Feb 2002, Johnson, Shaunn wrote:

> Howdy:
>
> Silly question.  I want to display the date from
> my table in other formats.  Is this possible?
>
> For example, I have this:
>
> [example]
>
>     date
> ------------
>  2000-01-07
>
> [/example]
>
> And I want this:
>
> [example]
>
>     date
> ------------
>  20000107
>
> [/example]
>
>
> And maybe this:
>
>
> [example]
>
>     date
> ------------
>  01/07/2001
>
> [/example]
>
>
> Any suggestions?  Thanks!
>
> -X
>


pgsql-general by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Function to Pivot data
Next
From: "omid omoomi"
Date:
Subject: Re: date functions