Re: Julian day to Informix date conversion
Posted in 1998
pygk@my-dejanews.com wrote: > Hello, > > Are there any 4gl/C routines that convert a Julian day to mm/dd/yyyy format? > > Example: Julian date = 2451117 -> 10/30/1998 > > I would also like to know if there are any routines that convert a Julian > date in the ccyyddd format to the mm/dd/yyyy format. > > Thanks. > > -----------== Posted via Deja News, The Discussion Network ==---------- > http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own We use RogueWave RWDates. They are julian beasts. Here is the coversion we use. RWDate ifxdate2rwdate(long ifxdate) { return ifxdate + 2415020L; } long rwdate2ifxdate(const RWDate &rwdate) { static const unsigned long days_to_1899 = 2415020; unsigned long juliandate = rwdate.julian(); return juliandate - days_to_1899; } -- -------------------------------------------------------------------------- Philip Walden Hewlett Packard Supply Chain Information Systems 1501 Page Mill Road, M/S 5L-A Palo Alto, CA 94304 (415) 857-3899 FAX (415) 857-8234 http://www.scis.hp.com/~pwalden mailto:phil_walden@hp.com --------------------------------------------------------------------------