Re: this date format thing.

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Peter Haworth <pmh(at)edison(dot)ioppublishing(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: this date format thing.
Date: 2003-04-03 14:17:05
Message-ID: 20030403141705.GF5926@zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)zf(dot)jcu(dot)cz>
http://home.zf.jcu.cz/~zakkr/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2003-04-03 14:25:25 Re: Problem to add a delay to a date
Previous Message Arjen van der Meijden 2003-04-03 14:00:05 Re: images in database