Skip site navigation (1) Skip section navigation (2)

Re: What is the binary format for timestamps?

From: Marvin Bellamy <marvin(dot)bellamy(at)innovision(dot)com>
To:
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: What is the binary format for timestamps?
Date: 2005-04-08 14:32:38
Message-ID: 42569606.8030503@innovision.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
Tom Lane wrote:

>Marvin Bellamy <marvin(dot)bellamy(at)innovision(dot)com> writes:
>  
>
>>I'm trying to read/write timestamps as binary data, but I'm getting 
>>garbage.  It looks like there are 8 bytes of timestamp data (if I read 
>>the headers correctly), which I had assumed was the time in millis from 
>>the PostgreSQL epoch, but my values are way off.
>>    
>>
>
>Are you using integer datetimes?  It should be either a float8 measured
>in seconds, or an int8 measured in microseconds since the epoch.
>
>			regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: if posting/reading through Usenet, please send an appropriate
>      subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>      message can get through to the mailing list cleanly
>
>  
>
I've been treating the timestamp as an integer, not a double.  What's a 
good way to deal with double/float byte ordering when reading/writing 
data from Windows applications?

-- 
Marvin Keith Bellamy
Software Engineer
Innovision Corporation
913.438.3200


In response to

Responses

pgsql-interfaces by date

Next:From: Tom LaneDate: 2005-04-08 14:46:02
Subject: Re: What is the binary format for timestamps?
Previous:From: Bruno Wolff IIIDate: 2005-04-08 14:07:52
Subject: Re: What is the binary format for timestamps?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group