Re: Using YY-MM-DD date input

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>
Cc: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>, PostgreSQL-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Using YY-MM-DD date input
Date: 2003-07-26 15:27:26
Message-ID: 200307261527.h6QFRQi04540@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Patrick Welche wrote:
> On Fri, Jul 25, 2003 at 04:13:12PM -0500, Ron Johnson wrote:
> > On Fri, 2003-07-25 at 15:02, Bruce Momjian wrote:
> > > Does anyone use YY-MM-DD for date input?
> > >
> > > Right now, it only works mostly for pre-2000 dates because we can detect
> > > that 97-02-03 is a year, while we can not detect that in 03-02-01.
> > >
> > > We are considering eliminating it for 7.4. You can still use
> > > yyyy-mm-dd, or course.
> > >
> > > Comments?
> >
> > What about the sliding window approach that some used to "solve"
> > the y2k problem: any year between, say '00' and '32' is presumed
> > to be in the 21st century, but years between '33' and '99' are
> > 20th century.
> >
> > However, dropping it and letting the app deal with it is my non-
> > counting vote...
>
> Mine too - as time goes by, we would also want to move the window
> 32][33 above etc, so simplest is if 03-02-01 would just be 3rd Feb
> 1AD, 2nd Mar 1AD or 1st Feb 3AD according to DMY, MDY or YMD. Still
> not clear to me how you make a difference between input and output
> encoding with a single DateStyle GUC variable.. DMY MDY and YMD
> just for input, US and European just for output?

We really can't do that because too many people are using a trailing YY
to mean current century, or most recent year with that suffix. For
leading years, you have to specify it as 0001, rather than just 01.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2003-07-26 15:52:38 Re: Wacky query plan, why?
Previous Message greg 2003-07-26 15:17:18 Re: Using YY-MM-DD date input