X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9B18653251 for ; Fri, 8 Apr 2005 15:34:36 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 35260-01 for ; Fri, 8 Apr 2005 14:34:31 +0000 (GMT) Received: from firewall.innovision.com (64-126-22-242.biztype2.everestkc.net [64.126.22.242]) by svr1.postgresql.org (Postfix) with ESMTP id 4B4D753234 for ; Fri, 8 Apr 2005 15:34:30 +0100 (BST) Received: from [10.10.10.189] (unverified [10.10.10.189]) by innovision.com (SurgeMail 2.2g3) with ESMTP id 3135 for ; Fri, 08 Apr 2005 09:34:34 -0500 Message-ID: <42569606.8030503@innovision.com> Date: Fri, 08 Apr 2005 09:32:38 -0500 From: Marvin Bellamy User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 Cc: pgsql-interfaces@postgresql.org Subject: Re: What is the binary format for timestamps? References: <4255A00F.1010409@innovision.com> <23104.1112917952@sss.pgh.pa.us> In-Reply-To: <23104.1112917952@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Server: High Performance Mail Server - http://surgemail.com X-Authenticated-User: mbellamy@innovision.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200504/28 X-Sequence-Number: 5444 Tom Lane wrote: >Marvin Bellamy 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@postgresql.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