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

to_date problem

From: leif(at)danmos(dot)dk
To: pgsql-interfaces(at)postgresql(dot)org
Subject: to_date problem
Date: 2001-03-15 07:37:26
Message-ID: 200103150737.f2F7bQl13172@crysberg.dk (view raw or flat)
Thread:
Lists: pgsql-interfaces
   Hello,

  I have just observed the following problem:

-------------------------------------------------------------------
testdb=# select to_date('2001-3-5 10:00', 'YYYY-MM-DD HH24:MI') from dual;
  to_date   
------------
 2001-03-10
(1 row)

testdb=# \q
[nsadmin(at)ljserv calendar]$ psql --version
psql (PostgreSQL) 7.1beta3
contains readline, history support
Portions Copyright (c) 1996-2000, PostgreSQL, Inc
Portions Copyright (c) 1996 Regents of the University of California
Read the file COPYRIGHT or use the command \copyright to see the
usage and distribution terms.
-------------------------------------------------------------------

   I know that the date constant is not in the same format as the format
string, but shouldn't it be an error rather than 'just' returning a
wrong date?

    Any suggestions,

  Leif
  (leif(at)danmos(dot)dk)

Responses

pgsql-interfaces by date

Next:From: Karel ZakDate: 2001-03-15 10:27:48
Subject: Re: to_date problem
Previous:From: St├ęphane EVEILLARDDate: 2001-03-15 06:42:04
Subject: Big trouble with libpq++

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