Re: now() vs 'epoch'::timestamp - Mailing list pgsql-general

From James Cloos
Subject Re: now() vs 'epoch'::timestamp
Date
Msg-id m3d23nfulg.fsf@carbon.jhcloos.org
Whole thread Raw
In response to Re: now() vs 'epoch'::timestamp  (Stephen Frost <sfrost@snowman.net>)
List pgsql-general
>>>>> "SF" == Stephen Frost <sfrost@snowman.net> writes:

>> (now()::timestamp without time zone - 'epoch'::timestamp without time zone)::reltime::integer
>> (Incidently, is there a better way in 9.4?)

SF> Uh, select extract('epoch' from now()); ?

Thanks.  Back when I first needed it (years ago), that long line was the
only recomendation I could find.

SF> The only thing I'd say about this is that you *really* want to use
SF> timestamptz in PG for storing timestamps.

I normally do, but this table hasn't changed in years.  Maybe 7.4 or so
was current when it started.

Thanks!

-JimC
--
James Cloos <cloos@jhcloos.com>         OpenPGP: 0x997A9F17ED7DAEA6

pgsql-general by date:

Previous
From: TonyS
Date:
Subject: Re: Would like to know how analyze works technically
Next
From: Steve Crawford
Date:
Subject: Re: now() vs 'epoch'::timestamp