<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>Peter&#039;s Useful Crap - Topic: Having the countdown treat a day as midnight-to-midnight</title>
	<link>http://www.theblog.ca/peter-forum/peters-date-countdown/having-the-countdown-treat-a-day-as-midnight-to-midnight</link>
	<description><![CDATA[Useful tips on Canada, cell phones, banking, technology, WordPress, PHP and more]]></description>
	<generator>Simple:Press Version 5.5.1</generator>
	<atom:link href="http://www.theblog.ca/peter-forum/peters-date-countdown/having-the-countdown-treat-a-day-as-midnight-to-midnight/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Peter on Having the countdown treat a day as midnight-to-midnight</title>
        	<link>http://www.theblog.ca/peter-forum/peters-date-countdown/having-the-countdown-treat-a-day-as-midnight-to-midnight#p310</link>
        	<category>Peter's Date Countdown</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-date-countdown/having-the-countdown-treat-a-day-as-midnight-to-midnight#p310</guid>
        	        	<description><![CDATA[<p>This is a question I got via e-mail:</p>
<blockquote><p>I can’t get the countdown to show actual “sleeps” per se.  In other words.. I think you are defining sleeps as every 24 hours??  And as such, I have one event at 6pm on the 10th and one event the following morning at 8am yet they both show the same number of winks or sleeps.</p>
<p>My website is <a href="http://www.hotforwords.com" rel="nofollow">http://www.hotforwords.com</a> lower right corner you’ll see the countdown.</p>
<p>Is there something I can tweak to have the winks related to say before and after midnight?</p>
</blockquote>
<p>Will you be using countdowns by day only ($showhours and $showminutes settings as “false”)?  If so, you can find this code:</p>
<p><input type="button" class="sfcodeselect" name="sfselectit7161" value="Select Code" onclick="spjSelectCode('sfcode7161');" /></p>
<div class="sfcode" id="sfcode7161">
// subtract desired date from current date and give an answer in terms of days<br />
$remain = $dc_timestamp - (time() + $timediff * 3600);
</div>
<p>And replace the $remain line with this:</p>
<p><input type="button" class="sfcodeselect" name="sfselectit8620" value="Select Code" onclick="spjSelectCode('sfcode8620');" /></p>
<div class="sfcode" id="sfcode8620">
$remain = ceil(($dc_timestamp + date(&#39;Z&#39;)) / 86400) * 86400 - date(&#39;Z&#39;) - (time() + $timediff * 3600);
</div>
<p>Also, find this code:</p>
<p><input type="button" class="sfcodeselect" name="sfselectit1227" value="Select Code" onclick="spjSelectCode('sfcode1227');" /></p>
<div class="sfcode" id="sfcode1227">
if (!$showhours) {<br />
$remain = ceil($remain / 86400);
</div>
<p>And replace the $remain line with this:</p>
<p><input type="button" class="sfcodeselect" name="sfselectit4576" value="Select Code" onclick="spjSelectCode('sfcode4576');" /></p>
<div class="sfcode" id="sfcode4576">
$remain = floor($remain / 86400);
</div>
<p>The two changes above should treat all dates as if they occur at midnight the same day, while still displaying them as the correct time:</p>
<p>In other words, suppose your event was on a Sunday at 8pm.  On Saturday at 11pm, it says “1 day remaining”.  On Sunday at 12:01am it will display “0 days remaining”.</p>
<p>If you also want to have hourly and minute countdowns, then it gets more complicated with a bit more tweaking…</p>
]]></description>
        	        	<pubDate>Sat, 05 Apr 2008 14:11:59 +0000</pubDate>
        </item>
</channel>
</rss>