Thread: problem with date

problem with date

From
David Sauer
Date:
Hello,

 I have problem with date:

# current date from OS prompt ...
% LC_ALL=C date
Wed Oct 27 21:08:56 CEST 1999

david=> select date('now');
      date
----------
01-01-2000
(1 row)

I expect current date, not 1.1.2000 ... interesting solution of Y2K problem,
but unusable ...

david=> select date('now'::date);
      date
----------
10-27-1999
(1 row)

This works, but why I need cast ?

david=> select date('hhhh');
date
-------------
11--2-4714 BC

I expect something like 'Bad external representation ....'

And finally, I have question: is there difference between
"date('now')" and "date(now())" ?


My pgsql version:

david=> select version();
version
-------------------------------------------------------------
PostgreSQL 6.5.2 on i586-pc-linux-gnu, compiled by gcc 2.95.1
(1 row)

I have glibc from RH 6.1.


                                                Thanks,

--
* David Sauer, student of Czech Technical University
* electronic mail: davids@penguin.cz (mime compatible)