convert date in lilian format for shell (AIX)

hello !

can so help me ? i'm writting a shell srcipt ( UNIX AIX) and I'd like to convert a date as 20041108 in lilian format.

thanks so much

According to a web site I found:

148138 = 1988-5-16
148139 = 5/17/1988

these are two examples of lilian dates from an IBM website.

Using ksh,

function lil { datecalc -j $(( $1 - 100841)) ; }

defines a function and then "lil 148138" results in "1988 5 16". This function depends on my datecalc script.

And you know where to get datecalc, since it is mentioned in the "Yesterdays Date/Date Arithmetic" article in our FAQ section which you certainly read before you posted your question. :wink:

This was an interesting question. I had never heard of lilian date format before. It looks like IBM went to a lot of trouble to re-invent the wheel. As far as I can see, the only difference between lilian date format and the standard mjd is, well, 100,841 days.

Thank you so much Perderabo ; I was about to change my algorithm when you answered me ! and ... i found your datecalc script in FAQ !!

Bye !