The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: Date function
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 10-11-2008
c00kie88 c00kie88 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 63
i made some syntax modification which are:

#old=1/1/07
old=`date +%d%m%y`
var="(`(date -u $old "+%s")`/ 86400)"
echo $var

but i have a problme with the third line..

when i read man page for date, it only supports

usage: date [-u] mmddHHMM[[cc]yy][.SS]
date [-u] [+format]
date -a [-]sss[.fff]

i'm guessing i should use -u but i think it's wrong

Last edited by c00kie88; 10-11-2008 at 08:53 AM..