Email address obfuscation in effect -- please
click here to turn it off.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
On Thu, 1 Feb 2007, Vern Green wrote:
Oh, I misunderstood you Mike, the way you wrote it made it sound like
you were counting the days until the election was to take place in eager
anticipation.
No, that wasn't it, but I didn't explain it at all!
Enough to know exactly how many days it is, of course if you also listed
hour, minute and second, I would have had to make a call to the people
with the white jackets with long arms... For your protection of course.
Here you go:
http://taxa.epi.umn.edu/cgi-bin/election
Let's make it open source so that anyone can critique my code. There are
probably much better ways to do this, and it's tcsh (old habit -- I'm
moving everything to bash now)....
-----------------begin script on next line------------------------
#!/usr/local/bin/tcsh -f
set time1=`date +%s`
set time2=`date -d 'Nov 4 20:00:00 PST 2008' +%s`
set seconds=`echo $time2 $time1 | gawk '{print $1-$2}'`
set days=`echo $seconds | gawk '{print int($1/(24*60*60))}'`
set hrs=`echo $seconds $days | gawk '{print int($1/(60*60))-$2*24}'`
set mins=`echo $seconds $days $hrs | gawk '{print int($1/60)-$2*24*60-$3*60}'`
set secs=`echo $seconds $days $hrs $mins | gawk '{print $1-$2*24*60*60-$3*60*60-$4*60}'`
echo ''
echo Only ${days} days, $hrs hours, $mins minutes and $secs seconds until
echo the polls close on Election Day 2008\!\!
-----------------end script on previous line----------------------
Mike
_______________________________________________
discussion mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/discussion