Re: problem with unixtime conversion - Mailing list pgsql-general

From Tom Lane
Subject Re: problem with unixtime conversion
Date
Msg-id 17382.1042568343@sss.pgh.pa.us
Whole thread Raw
In response to problem with unixtime conversion  ("Nathan Suderman" <nathan@pollstar.com>)
List pgsql-general
"Nathan Suderman" <nathan@pollstar.com> writes:
> test=> select date(date_part('epoch','now'::date)::int);
> ERROR:  Bad date external representation '1042502400'

I think your code was relying on the int->abstime coercion, which was
implicitly invokable before 7.3, but now has to be specified explicitly.

regression=# select date(date_part('epoch','now'::date)::int::abstime);
    date
------------
 2003-01-13
(1 row)


            regards, tom lane

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Server error and deadlocks
Next
From: Ben
Date:
Subject: Re: problem with unixtime conversion