Unix/Linux Go Back    


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

convert date in lilian format for shell (AIX)

AIX


Tags
aix, unix

Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 11-08-2004
chocolate chocolate is offline
Registered User
 
Join Date: Nov 2004
Last Activity: 30 December 2004, 2:48 AM EST
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 Unix and Linux 11-08-2004
Perderabo's Unix or Linux Image
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 7 April 2015, 12:31 PM EDT
Location: Ashburn, Virginia
Posts: 9,931
Thanks: 64
Thanked 446 Times in 263 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. Unix or Linux Image

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 Unix and Linux 11-09-2004
chocolate chocolate is offline
Registered User
 
Join Date: Nov 2004
Last Activity: 30 December 2004, 2:48 AM EST
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 Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image 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 04:17 AM.