Re: [GENERAL] Question on timestamp in psql

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Robert Rothe <rrothe(at)mindspring(dot)com>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Question on timestamp in psql
Date: 2000-01-11 16:28:39
Message-ID: 200001111628.LAA10481@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> When I type the following at the psql prompt:
>
> select timestamp('now');
>
> ...I always get december 31, 1999.
>
> If I use 'now' as the rvalue to a SET, or within an INSERT, it returns
> the correct date.
>
> Is this a known problem? I'm running 6.5.2-1.

Yikes, confirmed in current sources:

test=> select timestamp('now');
timestamp
------------------------
1999-12-31 19:00:00-05
(1 row)

This works:

test=> select timestamp('now'::timestamp);
timestamp
------------------------
2000-01-11 11:28:08-05
(1 row)

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Frank Mandarino 2000-01-11 16:42:14 Re: [GENERAL] Re: can't seem to use index
Previous Message Robert Rothe 2000-01-11 16:17:31 Question on timestamp in psql