Re: What is the binary format for timestamps?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marvin Bellamy <marvin(dot)bellamy(at)innovision(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: What is the binary format for timestamps?
Date: 2005-04-07 23:52:32
Message-ID: 23104.1112917952@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message ljb 2005-04-08 01:02:07 Re: What is the binary format for timestamps?
Previous Message Marvin Bellamy 2005-04-07 21:03:11 What is the binary format for timestamps?