<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Help Me Morbidly Count Down the Remaining Days of My Life!</title>
	<link>http://ask.metafilter.com/72555/Help-Me-Morbidly-Count-Down-the-Remaining-Days-of-My-Life/</link>
	<description>Comments on Ask MetaFilter post Help Me Morbidly Count Down the Remaining Days of My Life!</description>
	<pubDate>Thu, 27 Sep 2007 15:20:47 -0800</pubDate>
	<lastBuildDate>Thu, 27 Sep 2007 15:20:47 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Help Me Morbidly Count Down the Remaining Days of My Life!</title>
		<link>http://ask.metafilter.com/72555/Help-Me-Morbidly-Count-Down-the-Remaining-Days-of-My-Life</link>	
		<description>I would basically like to rip off, wholesale, some command-line script which will provide me a countdown -- only in days.  No years, months, minutes, or seconds.  Unfortunately, adapting an existing script is beyond my ken. &lt;br /&gt;&lt;br /&gt; &lt;a href=&quot;http://kk.org/ct2/2007/09/my-life-countdown-1.php&quot;&gt;This idea of Kevin Kelly&apos;s&lt;/a&gt; inspired me to perhaps try something similar to motivate me towards working more diligently towards long-term personal goals, but I&apos;m not an iGoogle user.  I&apos;d like to instead set it up as the result of a shell script which I can then pipe through GeekTool onto my Mac OS X desktop.&lt;br&gt;
&lt;br&gt;
The only problem is that there is a lot of Googlenoise out there clogging up the results, and I can&apos;t seem to find the kind of script I&apos;m looking for.  I did find a countdown script that would tell it to me in years, months, days, horus minutes, and seconds -- but I really would prefer a days-only readout, similar to that depicted on the page.  And I see various Javascript to include on webpages -- but I&apos;m looking for something to be done locally, and I can&apos;t use the Javascript and then pipe it through lynx or links, since when I bring up such a page using either, the Javascript result doesn&apos;t seem to show.  (I doubt lynx or links has Javascript support, do they?)&lt;br&gt;
&lt;br&gt;
Anyway, can anyone point me towards a shell script that will take the present date, subtract it from a future date, and tell me the number of days between then and now?&lt;br&gt;
&lt;br&gt;
I should add that I&apos;m an idiot savante when it comes to shell scripting and Perl ... more of a splicer than anything resembling a programmer.  I can sometimes look at code and grok a little of what it&apos;s saying, but telling me to embed the Doohickie:Flippa library into the Perl output by piping it through the black hole matrix into my Bananaphone is going to make me look at you blankly. &lt;br&gt;
&lt;br&gt;
Thanks!</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2007:site.72555</guid>
		<pubDate>Thu, 27 Sep 2007 15:16:04 -0800</pubDate>
		<dc:creator>WCityMike</dc:creator>
		
			<category>countdown</category>
		
			<category>shell</category>
		
			<category>perl</category>
		
			<category>script</category>
		
			<category>unix</category>
		
			<category>mac</category>
		
			<category>os</category>
		
			<category>x</category>
		
			<category>macosx</category>
		
			<category>osx</category>
		
			<category>resolved</category>
		
	</item> <item>
		<title>By: fvw</title>
		<link>http://ask.metafilter.com/72555/Help-Me-Morbidly-Count-Down-the-Remaining-Days-of-My-Life#1080110</link>	
		<description>echo $((($(date +%s -d &quot;2008-01-01&quot;) - $(date +%s -d now ))/86400))&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Shoudl work in any bourne-like shell.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.72555-1080110</guid>
		<pubDate>Thu, 27 Sep 2007 15:20:47 -0800</pubDate>
		<dc:creator>fvw</dc:creator>
	</item><item>
		<title>By: fvw</title>
		<link>http://ask.metafilter.com/72555/Help-Me-Morbidly-Count-Down-the-Remaining-Days-of-My-Life#1080111</link>	
		<description>But requires the GNU coreutils date(1) as the macOS version doesn&apos;t do -d. Oops.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.72555-1080111</guid>
		<pubDate>Thu, 27 Sep 2007 15:23:30 -0800</pubDate>
		<dc:creator>fvw</dc:creator>
	</item><item>
		<title>By: blacklite</title>
		<link>http://ask.metafilter.com/72555/Help-Me-Morbidly-Count-Down-the-Remaining-Days-of-My-Life#1080182</link>	
		<description>1. &lt;code&gt;sudo cpan Date::Calc&lt;/code&gt;&lt;br&gt;
That&apos;ll install the perl Date::Calc module and all its dependencies. You may have to go through a bit of questioning if you&apos;ve never installed a module before -- accept all the defaults and you&apos;ll be fine. Defaults are displayed in square brackets and you can accept them just by pressing enter. If you&apos;ve messed with script stuff even a little you should have the technical know-how to at least plow through it. It leads you through fairly well.&lt;br&gt;
&lt;br&gt;
Anyway, that&apos;ll run for a minute or so. It might seem like a big deal, for all the stuff it&apos;ll print to your terminal window, but it really isn&apos;t, it&apos;s just some handy date code.&lt;br&gt;
&lt;br&gt;
2. This perl script:&lt;br&gt;
&lt;small&gt;&lt;code&gt;use strict;&lt;br&gt;
use Date::Calc qw(Delta_Days Today);&lt;br&gt;
&lt;br&gt;
my @target = (2008, 01, 01); # year, month, day&lt;br&gt;
&lt;br&gt;
my $days = Delta_Days(Today(), @target);&lt;br&gt;
&lt;br&gt;
print &quot;$days days remaining.\n&quot;;&lt;/code&gt;&lt;/small&gt;&lt;br&gt;
&lt;br&gt;
There&apos;s a lot of other things you can do with Date::Calc, if you&apos;re interested: documentation is &lt;a href=&quot;http://search.cpan.org/~stbey/Date-Calc-5.4/Calc.pod&quot;&gt;here&lt;/a&gt;.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.72555-1080182</guid>
		<pubDate>Thu, 27 Sep 2007 16:28:28 -0800</pubDate>
		<dc:creator>blacklite</dc:creator>
	</item><item>
		<title>By: pocams</title>
		<link>http://ask.metafilter.com/72555/Help-Me-Morbidly-Count-Down-the-Remaining-Days-of-My-Life#1080184</link>	
		<description>Depending on how dedicated you are to using pure shell script, either of these should do the trick (tested on 10.4):&lt;br&gt;
&lt;br&gt;
I like the readability of this one:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
python -c &apos;from datetime import *; print (date(2007, 10, 01) - date.today()).days&apos;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
This one allows a lot of flexibility specifying the date (&quot;tomorrow&quot;, &quot;next Tuesday&quot;, &quot;January 1st 2008&quot;):&lt;br&gt;
&lt;code&gt;&lt;br&gt;
echo &apos;&amp;lt;?=(int)((strtotime(&quot;Oct 1&quot;)-time())/86400)?&amp;gt;&apos; | php&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;small&gt;Yeah, it&apos;s overkill, but it works.&lt;/small&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.72555-1080184</guid>
		<pubDate>Thu, 27 Sep 2007 16:29:02 -0800</pubDate>
		<dc:creator>pocams</dc:creator>
	</item><item>
		<title>By: pocams</title>
		<link>http://ask.metafilter.com/72555/Help-Me-Morbidly-Count-Down-the-Remaining-Days-of-My-Life#1080186</link>	
		<description>Now that I test again, my two pieces of code give different output.  The first is &quot;how many human days between now and then, inclusive&quot;, so there are four days from now to Oct 1st.  The second is &quot;how many full day-long intervals&quot;, so it returns three.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.72555-1080186</guid>
		<pubDate>Thu, 27 Sep 2007 16:33:24 -0800</pubDate>
		<dc:creator>pocams</dc:creator>
	</item>
	</channel>
</rss>
