Re: Time

From: Ragnar Hafstað <gnari(at)simnet(dot)is>
To: Rob Kirkbride <rob(dot)kirkbride(at)thales-is(dot)com>
Cc: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Time
Date: 2005-04-04 13:32:16
Message-ID: 1112621536.19933.17.camel@localhost.localdomain
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2005-04-04 at 13:49 +0100, Rob Kirkbride wrote:
> Hi,
>
> I'm trying to fetch out the epoch value of a time, the data type is
> 'timestamp with time zone'. When I do select extract(epoch from time) it
> returns a fractional part as well.
> Am I doing this the correct way? Is the fractional part microseconds?

no, it is fractions of a second.

test=# select extract(epoch from '2005-04-04 14:00:00.000000
+00'::timestamptz);
date_part
------------
1112623200
(1 row)

test=# select extract(epoch from '2005-04-04 14:00:00.123400
+00'::timestamptz);
date_part
-----------------
1112623200.1234
(1 row)

the accuracy probably depends on your platform

gnari

In response to

  • Time at 2005-04-04 12:49:52 from Rob Kirkbride

Browse pgsql-general by date

  From Date Subject
Next Message John Burger 2005-04-04 14:20:24 Re: Crazy Multiplication Issue
Previous Message Rob Kirkbride 2005-04-04 12:49:52 Time