Thread: European Datestyle

European Datestyle

From
Daniele Orlandi
Date:
Hello,

Why is this happening ?

ctonet=# show datestyle;
NOTICE:  DateStyle is ISO with European conventions
SHOW VARIABLE

ctonet=# select creation_date from users limit 1;    creation_date      
------------------------2000-12-07 04:40:23+01^^^^^^^^^^

Datestyle has been set either with -e and with "set datestyle" with no
change.

Context: Postgresql 7.0.3 on RedHat Linux 7.0 - Kernel 2.4.0-test10 -
Glibc 2.1.94 and 2.2

Thanks!
Bye!

-- Daniele Orlandi


Re: European Datestyle

From
teg@redhat.com (Trond Eivind GlomsrØd)
Date:
Daniele Orlandi <daniele@orlandi.com> writes:

> Hello,
> 
> Why is this happening ?
> 
> ctonet=# show datestyle;
> NOTICE:  DateStyle is ISO with European conventions
> SHOW VARIABLE
> 
> ctonet=# select creation_date from users limit 1;
>      creation_date      
> ------------------------
>  2000-12-07 04:40:23+01
>  ^^^^^^^^^^

That is the ISO-style, isn't it?

There are two ways of making dates make sense, none of them American
(but hey, they're still using Fahrenheit, feet, lb, fl.oz. acres and
other nonsensical units... )
-- 
Trond Eivind Glomsrød
Red Hat, Inc.


Re: European Datestyle

From
Daniele Orlandi
Date:
Trond Eivind GlomsrØd wrote:
> 
> >  2000-12-07 04:40:23+01
> >  ^^^^^^^^^^
> 
> That is the ISO-style, isn't it?

Yes, it is; but according to the documentation (and how it used to be on
other machines running PG 6.x) it should be ordered in european format,
I don't know
if I'm missing something obviuous or what...

> There are two ways of making dates make sense, none of them American
> (but hey, they're still using Fahrenheit, feet, lb, fl.oz. acres and
> other nonsensical units... )

I do not mean to cricticize british units, after all, I would have
preferred base16 units instead of base10 :)

Bye!

-- Daniele

-------------------------------------------------------------------------------Daniele Orlandi - Utility Line Italia -
http://www.orlandi.comViaMezzera 29/A - 20030 - Seveso (MI) - Italy
 
-------------------------------------------------------------------------------


Re: European Datestyle

From
Thomas Lockhart
Date:
> > That is the ISO-style, isn't it?
> Yes, it is; but according to the documentation (and how it used to be on
> other machines running PG 6.x) it should be ordered in european format,

The documentation should be clear that this is the correct output,
giving the current "datestyle" settings. Please let me know what part
was confusing and I can fix it for the next release.

The default date style in 7.0 was changed from "Postgres" to "ISO". The
euro vs US setting determines how *input* dates are interpreted, since
they are not restricted to being only the format of the default output
style.

Use "set datestyle = 'Postgres,European'" to change to what you expect.
You can set an environment variable or change the defaults when building
the backend to get this always.

There is an appendix in the docs discussing the parsing strategy, though
it is all detail.
                     - Thomas