pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: H Hale <hhale21@yahoo.com>
To: pgsql-interfaces@postgresql.org
Subject: Re: [GENERAL] binary timestamp conversion
Date: Fri, 14 Oct 2005 13:00:01 -0700 (PDT)
Message-ID: <20051014200002.89011.qmail@web52315.mail.yahoo.com> (raw)

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/



view thread (5+ messages)  latest in thread

Message-ID: <20051014200002.89011.qmail@web52315.mail.yahoo.com>
Permalink:  ../20051014200002.89011.qmail@web52315.mail.yahoo.com/
Also on:    postgresql.org/message-id/20051014200002.89011.qmail@web52315.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: hhale21@yahoo.com
  Subject: Re: [GENERAL] binary timestamp conversion
  In-Reply-To: <20051014200002.89011.qmail@web52315.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox