Go Back   The UNIX and Linux Forums > Operating Systems > AIX


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 11-08-2004
Registered User
 
Join Date: Nov 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Data 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
Sponsored Links
    #2  
Old 11-08-2004
Perderabo's Avatar
Unix Daemon (Adminstrator Emeritus)
 
Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,692
Thanks: 27
Thanked 294 Times in 168 Posts
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.

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.
Sponsored Links
    #3  
Old 11-09-2004
Registered User
 
Join Date: Nov 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Computer

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 !
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
convert date format dba_frog Shell Programming and Scripting 3 04-29-2011 01:37 AM
Convert date to Unix format yahyaaa Shell Programming and Scripting 12 04-20-2011 09:31 AM
convert date format to mysql date format in log file hazno Shell Programming and Scripting 3 03-03-2009 08:05 AM
Convert date format agathaeleanor UNIX for Dummies Questions & Answers 5 08-03-2008 10:25 PM
convert mmddyy date format to ccyyddd format?? Bhups Shell Programming and Scripting 2 09-27-2006 11:30 PM



All times are GMT -4. The time now is 08:16 PM.