From: Ryan Mooney <ryan@pcslink.com>
To: Gonçalo Marrafa <gjm@uevora.pt>
Cc: L J Bayuk <ljb220@mindspring.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Date/Time atributes and binary cursors
Date: Tue, 6 Apr 2004 08:07:15 -1000
Message-ID: <20040406180715.GA82692@pcslink.com> (raw)
In-Reply-To: <20040406100403.3a60c461.gjm@uevora.pt>
References: <20040402155110.14a956a1.gjm@uevora.pt>
<200404060114.i361EsZ6000560@mindspring.com>
<20040406100403.3a60c461.gjm@uevora.pt>
select extract(epoch from timestamp 'oct 1 2004 10:11:17');
On Tue, Apr 06, 2004 at 10:04:03AM +0100, Gonçalo Marrafa wrote:
> Thanks.
>
> Do Postgres/libpq have functions for converting between Unix/Postgres date/time representations or do i have to do it by hand?
>
> Thanks again.
>
>
> > A date is returned as a 4-byte big-endian integer representing the number
> > of days since POSTGRES_EPOCH_DATE.
> > A timestamp is returned as an 8-byte big-endian double precision number of
> > seconds since POSTGRES_EPOCH_DATE.
> > A time is returned as an 8-byte big-endian double precision number of
> > seconds since midnight.
> > POSTGRES_EPOCH_DATE is January 1, 2000 (2000-01-01).
> >
> > Note that binary cursor results are in network data order (big-endian)
> > starting with PostgreSQL-7.4 (versus native server order pre-7.4). This
> > means they need to be byte-swapped if your client runs on an Intel-type
> > little-endian system.
> >
>
>
> --
> Gonçalo Marrafa <gjm@uevora.pt>
--
>-=-=-=-=-=-=-<>-=-=-=-=-=-<>-=-=-=-=-=-<>-=-=-=-=-=-<>-=-=-=-=-=-=-<
Ryan Mooney ryan@pcslink.com
<-=-=-=-=-=-=-><-=-=-=-=-=-><-=-=-=-=-=-><-=-=-=-=-=-><-=-=-=-=-=-=->
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: ryan@pcslink.com, gjm@uevora.pt, ljb220@mindspring.com
Subject: Re: Date/Time atributes and binary cursors
In-Reply-To: <20040406180715.GA82692@pcslink.com>
* 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