EPCOH: extract returns millisecs too?

From: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: EPCOH: extract returns millisecs too?
Date: 2002-08-15 04:22:15
Message-ID: 3D5B2C77.9020300@mega-bucks.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

From the iDocs:

epoch

For date and timestamp values, the number of seconds since
1970-01-01 00:00:00-00 (Result may be negative.); for interval values,
the total number of seconds in the interval

SELECT EXTRACT(EPOCH FROM TIMESTAMP '2001-02-16 20:38:40');
Result: 982352320

But if I seem to get milliseconds too in my queries:

$ psql sessions -c "SELECT EXTRACT(EPOCH FROM current_timestamp) as now"
now
------------------
1029298563.74248
(1 row)

Are the Docs out of date? How can I get EXTRACT to only return seconds?

Jc

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-08-15 05:00:05 Re: EPCOH: extract returns millisecs too?
Previous Message Tom Lane 2002-08-15 03:39:35 Re: Problem with Now()?