pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marvin Bellamy <marvin.bellamy@innovision.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: What is the binary format for timestamps?
Date: Thu, 07 Apr 2005 19:52:32 -0400
Message-ID: <23104.1112917952@sss.pgh.pa.us> (raw)
In-Reply-To: <4255A00F.1010409@innovision.com>
References: <4255A00F.1010409@innovision.com>

Marvin Bellamy <marvin.bellamy@innovision.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



view thread (6+ messages)  latest in thread

Message-ID: <23104.1112917952@sss.pgh.pa.us>
Permalink:  ../23104.1112917952@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23104.1112917952@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, marvin.bellamy@innovision.com
  Subject: Re: What is the binary format for timestamps?
  In-Reply-To: <23104.1112917952@sss.pgh.pa.us>

* 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