Re: getting julian number from date in libpq

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Norman Yamada <nyamada(at)millburncorp(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org, Yasser El-Zein <yelzein(at)millburncorp(dot)com>
Subject: Re: getting julian number from date in libpq
Date: 2005-09-08 19:45:06
Message-ID: 24865.1126208706@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Norman Yamada <nyamada(at)millburncorp(dot)com> writes:
> Postgresql stores dates as Julian days, but using libpq, I don't see
> how to get out a date quickly as a julian day. If I use PQgetvalue,
> my date is automagically converted into whatever my DATESTYLE is at
> the time. How can I just get out the internal julian date?

Something involving EXTRACT(EPOCH FROM timestamp) will probably solve
your problem.

regards, tom lane

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Norman Yamada 2005-09-08 19:51:44 Re: getting julian number from date in libpq
Previous Message Michael Fuhr 2005-09-08 19:37:43 Re: getting julian number from date in libpq