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 C90BB53773 for ; Fri, 8 Apr 2005 00:52: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 52873-06 for ; Thu, 7 Apr 2005 23:52:32 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id CA6D753745 for ; Fri, 8 Apr 2005 00:52:31 +0100 (BST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j37NqXUM023105; Thu, 7 Apr 2005 19:52:33 -0400 (EDT) To: Marvin Bellamy Cc: pgsql-interfaces@postgresql.org Subject: Re: What is the binary format for timestamps? In-reply-to: <4255A00F.1010409@innovision.com> References: <4255A00F.1010409@innovision.com> Comments: In-reply-to Marvin Bellamy message dated "Thu, 07 Apr 2005 16:03:11 -0500" Date: Thu, 07 Apr 2005 19:52:32 -0400 Message-ID: <23104.1112917952@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/23 X-Sequence-Number: 5439 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