12 Oct 2009 04:08
Solaris10 date calculation not working?
stephen price <sd_price <at> yahoo.com>
2009-10-12 02:08:07 GMT
2009-10-12 02:08:07 GMT
I'm trying to do a simple "what date is yesterday" shell script variable - without having to go to perl or something else. # todays date & time d1=`date +%Y%m%d%H%M` echo $d1 #yesterdays date & time - should be 24 hours back yesterday1=`TZ=US/Central+24 date +%Y%m%d%H%M` yesterday2=`TZ=CST6CDT+24 date +%Y%m%d%H%M` yesterday3=`TZ=America/Chicago+24 date +%Y%m%d%H%M` echo echo $yesterday1 echo $yesterday2 echo $yesterday3 200910111937 200910110037 200910110037 200910110037 Why is it only 19 hours back instead of the 24 hours ? I tried ksh & sh & bash - just in case korn wasn't handling correctly - but still got the same output. I'm sure I'm missing something simple - Any suggestions welcome ... steve _______________________________________________ SunHELP maillist - SunHELP <at> sunhelp.org http://www.sunhelp.org/mailman/listinfo/sunhelp(Continue reading)
RSS Feed