Re: now() vs 'epoch'::timestamp

From: James Cloos <cloos(at)jhcloos(dot)com>
To: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: now() vs 'epoch'::timestamp
Date: 2015-04-02 17:27:35
Message-ID: m38ueae8zc.fsf@carbon.jhcloos.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>>>>> "SC" == Steve Crawford <scrawford(at)pinpointresearch(dot)com> writes:

SC> Very convoluted calculation as others have noted. As to why it is
SC> "off", you are casting one part of the statement to an integer thus
SC> truncating the microseconds but are not doing the same on the other
SC> side of the calculation.

It wasn't the microsecond difference I asked about, it was the 6 hour difference.

The original, ancient code I used needed to return integer seconds. And
it always gave answers consistant with date +%s.

What I haven't determined is why converting back is off by 21600 seconds.

-JimC
--
James Cloos <cloos(at)jhcloos(dot)com> OpenPGP: 0x997A9F17ED7DAEA6

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2015-04-02 17:34:44 Re: now() vs 'epoch'::timestamp
Previous Message Taylor Brown 2015-04-02 17:15:53 Re: Why doesn't `RAISE EXCEPTION` provide error context?