Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-interfaces by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group