to_date bug

Поиск
Список
Период
Сортировка
Искать

to_date bug

От:
Jeff <jeff@downtown-office.com>
Дата:
select to_date('December 12 2002','Month dd yyyy');
  to_date   
------------
 2002-12-02

select to_date('January 12 2002','Month dd yyyy');        
  to_date   
------------
 0005-06-24     <----- Problem right there.


select to_date('January 12, 2002','Month dd, yyyy');
  to_date   
------------
 2002-01-01   <-- It should be 2002-01-12

select to_date('December 12, 2002','Month dd yyyy'); 
  to_date   
------------
 2002-12-02


For some reason it's getting caught up on January.  I know these dates are
Unambiguous however I think there might be a bug there.

It would be my first bug ;)

Re: to_date bug

От:
Karel Zak <zakkr@zf.jcu.cz>
Дата:
On Wed, Jun 12, 2002 at 10:54:53AM -0600, Jeff wrote:
> 
> select to_date('December 12 2002','Month dd yyyy');
>   to_date   
> ------------
>  2002-12-02
> 
> select to_date('January 12 2002','Month dd yyyy');        
>   to_date   
> ------------
>  0005-06-24     <----- Problem right there.

 Please, see docs...

test=# select to_date('January   12 2002','Month dd yyyy');
                              ^^
  to_date   
------------
 2002-01-12

test=# select to_date('January 12 2002','FMMonth dd yyyy');
                                         ^^
  to_date   
------------
 2002-01-12

 I try prepare it more robus for 7.3.

    Karel

-- 
 Karel Zak  
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
FAQ