My "Season Countdown" is:
Code
/* PHP CODE HERE */
if(date("U") <= mktime(0, 0, 0, 3, 20, 2013) /* hour, minute, second, month, day, year */) {
// Spring
$blurb = "until Summer begins";
$color = "FF0000";
$date = "June 21, 2013";
} elseif(date("U") <= mktime(0, 0, 0, 6, 21, 2013) /* hour, minute, second, month, day, year */) {
// Summer
$blurb = "until Summer begins";
$color = "FF0000";
$date = "June 21, 2013";
} elseif(date("U") <= mktime(0, 0, 0, 9, 22, 2013) /* hour, minute, second, month, day, year */) {
// Autumn
$blurb = "until Autumn begins";
$color = "F9930A";
$date = "September 22, 2013";
} elseif(date("U") <= mktime(0, 0, 0, 12, 21, 2013) /* hour, minute, second, month, day, year */) {
// Winter
$blurb = "until Winter begins";
$color = "81A4BA";
$date = "December 21, 2013";
} else {
$blurb = "";
$color = "";
$date = "";
}

/* BODY HERE */
$body = <<<EOF
<script language="JavaScript" type="text/javascript">
today = new Date();
BigDay = new Date("$date");
msPerDay = 24 * 60 * 60 * 1000;
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
e_hrsLeft = (e_daysLeft - daysLeft)*24;
hrsLeft = Math.floor(e_hrsLeft);
minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
document.write("<span style=\"color: #$color; font-family:'Comic Sans MS';\">Only " + daysLeft + " days " + hrsLeft +" hours and " + minsLeft + " minutes $blurb!</span>");
</script>
EOF;

Each season has a color and a blurb about it, the MKTime/Date will need to be changed each year; output shows as:
Quote
Only 43 days 3 hours and 4 minutes until Winter begins!

I thought about looking for a javascript ticker to visually count down, but on each page load works fine for my needs for now.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!