Binary Format of Timestamp - Mailing list pgsql-novice

From Joe Joe
Subject Binary Format of Timestamp
Date
Msg-id 20050621132805.12157.qmail@web32512.mail.mud.yahoo.com
Whole thread Raw
Responses Re: Binary Format of Timestamp
Re: Binary Format of Timestamp
List pgsql-novice
Hi all,

I have a timestamp in a database that is beeing
returned in pgAdmin as "2005-06-21 11:21:47", exactly
as entered. When i retrieve the field via PQgetvalue i
get 8 bytes worth of data that i can not interpret.
ColumnType is TIMESTAMPOID, and the field content is
binary, size is 8 bytes, also all as expected.
I expect the timestamp format to be a float8 type
containing the seconds elapsed sind the 1.1.2000. This
should roughly be something around 172668107, give and
take a few timezone adjustments. What i get back from
PQgetvalue is the following array of bytes:

0: 0x00
1: 0x00
2: 0x9d
3: 0x0a
4: 0x6d
5: 0x2e
6: 0x88
7: 0xc0

Handling these bytes like a double (i.e adjusting them
for network byteorder), returns a value of
8.530937980114e-310#DEN.
But no matter how i order these bytes, i cannot make
sense of them.

Platform is Win32, Postgres was installed from binary
distribution. Does anyone have a hint ?

Many thanks in advance,

Joe








____________________________________________________
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football
http://football.fantasysports.yahoo.com

pgsql-novice by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: [GENERAL] DANGER Windows version might hurt you
Next
From: "Warren Murray"
Date:
Subject: Fatal: password authentication failed for user "xxxxxx"