Re: this date format thing. - Mailing list pgsql-general

From Karel Zak
Subject Re: this date format thing.
Date
Msg-id 20030403141705.GF5926@zf.jcu.cz
Whole thread Raw
In response to Re: this date format thing.  ("Peter Haworth" <pmh@edison.ioppublishing.com>)
List pgsql-general
On Thu, Apr 03, 2003 at 12:36:07PM +0100, Peter Haworth wrote:
> On Wed, 2 Apr 2003 13:23:45 -0700 (MST), scott.marlowe wrote:
> > While situations where 04-02 would get put in when the user meant 02-04,
> > at least enough of the 02-13 cases would throw an error that the user
> > would know they had been doing something wrong along the way and would
> > hopefully go back and look at their data.
>
> You wish.
>
> jnlstats=> select '2001-31-12'::date;
>     date
> ------------
>  2001-12-31
> (1 row)
>
> jnlstats=> select to_date('2001-31-12','yyyy-mm-dd');
>   to_date
> ------------
>  2003-07-14
> (1 row)


 Are you sure is there 31 months ('mm')? I think better is:

 test=# select to_date('2001-31-12','yyyy-dd-mm');
   to_date
 ------------
  2001-12-31

    Karel

--
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/


pgsql-general by date:

Previous
From: Arjen van der Meijden
Date:
Subject: Re: images in database
Next
From: Richard Huxton
Date:
Subject: Re: Problem to add a delay to a date