problem with date - Mailing list pgsql-bugs

From David Sauer
Subject problem with date
Date
Msg-id m2wvs8mx4o.fsf@chameleon.localdomain
Whole thread Raw
List pgsql-bugs
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)

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [SQL] Date comparisons
Next
From: ednut
Date:
Subject: Re: Linux/Postgres 6.5 problems using jdbc w/jdk1.2