Skip site navigation (1) Skip section navigation (2)

Re: to_date() month translation

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: andyelf(at)yahoo(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: to_date() month translation
Date: 2001-06-18 10:34:13
Message-ID: 20010618123413.C22109@ara.zf.jcu.cz (view raw or flat)
Thread:
Lists: pgsql-bugs
On Fri, Jun 15, 2001 at 04:51:26PM -0400, pgsql-bugs(at)postgresql(dot)org wrote:

> Sample 1:
> ---------
> 
> template1=# select to_date('12-January-2001','DD-Month-YYYY');
>   to_date
> ------------
>  0001-01-12
> (1 row)
> 
> template1=# select to_date('12-January  -2001','DD-Month-YYYY');
>   to_date
> ------------
>  2001-01-12
> (1 row)
> 
> No file was uploaded with this report


 What is bad on the PostgreSQL documentation and mailing list archives?!

The month name string is 9-chars or you must use FM (fill-mode)option:

test=# select to_char(now(), 'Month DD');
   to_char
--------------
 June      18
(1 row)

test=# select to_char(now(), 'FMMonth DD');
 to_char
---------
 June 18
(1 row)

test=# select to_date('12-January-2001','DD-FMMonth-YYYY');
  to_date
------------
 2001-01-12
(1 row)

					Karel

-- 
 Karel Zak  <zakkr(at)zf(dot)jcu(dot)cz>
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

In response to

pgsql-bugs by date

Next:From: pgsql-bugsDate: 2001-06-18 16:48:57
Subject: Referential integrity problem
Previous:From: Steve SullivanDate: 2001-06-17 17:59:21
Subject: Memory leak in 7.0.3 JDBC driver

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group