Skip site navigation (1) Skip section navigation (2)

Re: changing datestyle

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Karl Nack <karlnack(at)futurityinc(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: changing datestyle
Date: 2009-06-16 17:36:01
Message-ID: 17939.1245173761@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
Karl Nack <karlnack(at)futurityinc(dot)com> writes:
>> (The fact that there are two components is a historical aberration,
>> and I'd be the first to agree it's ugly, but that's how it works.)

> My understanding is that the first component indicates how dates are 
> output by default, the second how dates are interpreted upon input 
> (to disambiguate between MDY and DMY).

The second one affects field order for some of the output styles, too.
See
http://www.postgresql.org/docs/8.3/static/datatype-datetime.html#DATATYPE-DATETIME-OUTPUT
In particular, tables 8-14 and 8-15 illustrate all the output formatting
options you have.  SQL, MDY might be the closest to what you want.

			regards, tom lane

In response to

Responses

pgsql-novice by date

Next:From: Karl NackDate: 2009-06-16 17:48:52
Subject: Re: changing datestyle
Previous:From: Karl NackDate: 2009-06-16 17:28:28
Subject: Re: changing datestyle

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group