Re: datestyle formatting - Mailing list pgsql-general

From Michael Fuhr
Subject Re: datestyle formatting
Date
Msg-id 20050111083704.GA28861@winnie.fuhr.org
Whole thread Raw
In response to datestyle formatting  (mstory@uchicago.edu)
List pgsql-general
On Tue, Jan 11, 2005 at 12:03:16AM -0600, mstory@uchicago.edu wrote:
>
> I need to know the day of the week for a schedule rotation algorithm
> i'm working on.

Others have already replied to this part.

> I've switched the datestyle format in the .conf file and used the
> set to command, but my output never reads as the example in the
> 7.4.6 docs it always shows just the dmy standard output 10-12-1999
> for example as opposed to wed oct 17 1987, any help on this would
> be appreciated

Apparently the 'Postgres' output format acts differently depending
on whether the value is a date or a timestamp:

SET datestyle TO 'Postgres, DMY';

SELECT current_date;
    date
------------
 11-01-2005
(1 row)

SELECT current_timestamp;
             timestamptz
-------------------------------------
 Tue 11 Jan 01:30:32.617394 2005 MST
(1 row)

The 'Postgres' output format also doesn't appear to support 'YMD',
always putting the year last:

SET datestyle TO 'Postgres, YMD';

SELECT current_date;
    date
------------
 01-11-2005
(1 row)

SELECT current_timestamp;
            timestamptz
-----------------------------------
 Tue Jan 11 01:31:25.6092 2005 MST
(1 row)

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-general by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: datestyle formatting
Next
From: Nirmalya Lahiri
Date:
Subject: Private or publice function