Re: Julian Date Conversion
Posted in 1997
Chris Kaeberlein wrote: > > Hello, fellow, Informix-ites. > > I'm in need of a function that will convert a datatype of DATETIME YEAR > TO DAY into a Julian date. I've searched all of the Informix literature > and CD documentation that I have at my disposal and haven't been able to > locate anything. The reason I need this function is that I need to > fragment a database table by the DATETIME field, and hopefully fragment > the data evenly across 4 fragments. However, I need to convert the > DATETIME field to a Julian value first in order to use the DATETIME > field in the fragmentation expression. Any help in this matter would be > much appreciated. > > TIA, > Chris > > -- > Chris Kaeberlein > Greenbrier and Russel, Inc. > ckaeberlein@gr.com For lack of time and lack of other easy methods, the way I handled this problem recently is to create a LONG INT field in the table, have a C++ application convert the date-time string to Julian (or epoch) format using the strptime and mktime utilities, then load the data. I am sure there must be a way to do the same in SQL, but who's got the time to look it up? Later, Arun