pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: A. Kretschmer <andreas.kretschmer@schollglas.com>
To: pgsql-sql@postgresql.org
Subject: Re: to_date function
Date: Fri, 7 Sep 2007 08:35:19 +0200
Message-ID: <20070907063519.GC10560@a-kretschmer.de> (raw)
In-Reply-To: <9bb664980709062222n13f66543kf621094604a9944e@mail.gmail.com>
References: <9bb664980709062222n13f66543kf621094604a9944e@mail.gmail.com>

am  Fri, dem 07.09.2007, um 17:22:30 +1200 mailte anru chen folgendes:
> Hi all:
> 
> i am use postgres 8.2 on windows XP, following select statement
> 
> "select to_date('10 August 2007','DD Month YYYY');"
> return me 0007-08-10,
> 
> if i do "select to_date('10 September 2007','DD Month YYYY');"
> result is correct 2007-09-10
> 
> seems like "to_date" function only work correctly for current month.

No, seems like to_char only work corrently if the length of the month
correctly...

test=*# select to_date('10 August    2007','DD Month YYYY');
  to_date
------------
 2007-08-10
(1 row)

test=*# select to_date('10 August   2007','DD Month YYYY');
  to_date
------------
 0007-08-10
(1 row)



But this is described, see:
http://www.postgresql.org/docs/current/static/functions-formatting.html

,----[  quote  ]
| MONTH	full uppercase month name (blank-padded to 9 chars)
| Month	full mixed-case month name (blank-padded to 9 chars)
| month	full lowercase month name (blank-padded to 9 chars)
`----



Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net



view thread (5+ messages)  latest in thread

Message-ID: <20070907063519.GC10560@a-kretschmer.de>
Permalink:  ../20070907063519.GC10560@a-kretschmer.de/
Also on:    postgresql.org/message-id/20070907063519.GC10560@a-kretschmer.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: andreas.kretschmer@schollglas.com
  Subject: Re: to_date function
  In-Reply-To: <20070907063519.GC10560@a-kretschmer.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox