Re: Postgres Date Type Value

From: Michael Arnold <myk321(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Postgres Date Type Value
Date: 2022-12-18 01:15:28
Message-ID: CAMOVWRgDa4scFoY9DxNykGBLh8Xob6fYo4oY8QK6tLJ=DgWDdQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

My bad - was referencing the wrong column with PQgetvalue(). With that
corrected, get 8332 for 2022-10-25. So date is an integer day count
from POSTGRES_EPOCH_JDATE
(2000-01-01).

Thanks for the help!
---------------

On Sun, Dec 18, 2022 at 8:24 AM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Sat, Dec 17, 2022 at 4:55 PM Michael Arnold <myk321(at)gmail(dot)com> wrote:
>
>> How do I interpret the 4 bytes of postgresql 'date' value?
>>
> See date2j and j2date in datetime.c
>
> timestamp.h has the relevant constant Tom refers to (POSTGRES_EPOCH_JDATE)
>
>
> David J.
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martin L. Buchanan 2022-12-18 02:39:44 integer square root function proposed
Previous Message David G. Johnston 2022-12-18 00:24:21 Re: Postgres Date Type Value