Re: [GENERAL] binary timestamp conversion

From: H Hale <hhale21(at)yahoo(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [GENERAL] binary timestamp conversion
Date: 2005-10-14 20:00:01
Message-ID: 20051014200002.89011.qmail@web52315.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

I originally incorrectly posted my question to the
GENERAL list with the same subject.

As I indicated in my original post I am trying to
convert an binary timestamp (int64).

After further experimentation I have yet to find a
method to correctly convert the int64 value retrieved
from a query.

I save 1970-01-01 00:00:00 and read it back expecting
the difference between postgres and unix epochs but
get different results each time.

(After conversion to host byte order).

-946686612744257
-946684195712577
-946684196834881

I then tried using PGTYPEStimestamp_to_asc() just to
see what it does and get....

1969-12-31 23:07:28.818367
1969-12-31 23:38:40.464063
1969-12-31 23:52:03.009727

psql shows 1970-01-01 00:00:00

Using 2000-01-01 the minutes/seconds/fractional
seconds varies as well.

If request back dates formattea as strings, I get what
psql shows, the correct result.

Why would pg returning inconsistent binary timestampo
results?

Thanks


__________________________________
Yahoo! Music Unlimited
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2005-10-14 21:04:35 Re: [GENERAL] binary timestamp conversion
Previous Message Bruce Momjian 2005-10-13 23:09:24 Re: [GENERAL] binary timestamp conversion