LSU Kickoff Countdown Timer NotesNote: Windows Vista does not include Active Desktop, so for now I can't suggest a method to get the timer to work in that operating system.
To adjust the loaded Active Desktop window:
If you open LSU-Countdown.htm in your web browser, you will see that the 3 text box entries appear side by side. The break lines in the form name="timeForm" section have been intentionally removed. This is in anticipation that you will resize the width of the Active Desktop window to be the width of a single text box. If you are using Windows 95 (A or B) or Windows NT and would like to install the Active Desktop, see http://www.tburke.net/info/win2k/win2kinfo.htm#DeskTopUpdate. If you have a question or a suggestion to make this better, please Email me at webadmin@lsufootball.net. Geaux Tigers!!! Editor's Note: The Countdown to Kickoff timer was created to put the timer on your desktop. It can easily be added to a web page, but please keep this in mind: It has taken a couple of years to get the java code to the point where it is now. I find it frustrating when people post it on their websites without citing where it came from. That implies that they came up with this on their own. Revisions to LSU-Countdown.htm for 2009: 01/29/08: Added games for 2009, changed the way the script is started. Technical Notes:The countdown timer is calculated based on the difference between your time and the values declared by the targetdates and should be accurate from anywhere in the world. It automatically adjusts to the next game after the kickoff time has passed for the previous game. Although the kickoff time that is displayed is for your time zone (this may only be true for Internet Explorer), it is correct since it is calculated based on the targetdate in the Central Time Zone.If your PC is not set to use Daylight Savings Time or if you live in an area that does not adjust to Daylight Savings Time (Arizona), then neither the countdown timer nor the kickoff time *may* be accurate while Daylight Savings Time is in effect. I made these notes to help me understand how the time correction part of this script works, the notes only cover that part of the script. I am not advocating this is the best way or even a good way to get it to work, this is just the trial and error method that I came up with. If you want to see just the source code without any notes, Go to LSU-Countdown.htm. Details:targetdate1 = new Date("Sep 01 2007 19:00:00 CDT"); ...; targetdate10 = new Date("Nov 10 2007 19:00:00 CST"); Game1 = ("LSU vs Middle Tennessee"); ...; Game10 = ("LSU vs Louisiana Tech"); Note the use of CDT vs CST for the TimezoneOffset values. The TimezoneOffset is the difference between Universal Time (UTC) and your time zone. The concept of UTC is very similar to GMT or Greenwich Mean Time, but UTC is used in astronomy and meteorology. Note: Adding in 14400000 creates a 4 hour delay after Kickoff, causing Geaux Tigers to be displayed for those 4 hours. if (now <= targetdate1 * 1 + 14400000) {targetdate = (targetdate1); game = (Game1);} ...; else if (now <= targetdate11 * 1 + 14400000) {targetdate = (targetdate10); game = (Game10);} The rest of this script basically converts now and targetdate into numerical values and then subtracts the value of now from the value of targetdate. If the time difference is positive, it uses this result to calculate and display the remaining time left. If the time difference is negative, the script moves to the next declared date and will continue to do so until it finds a positive result or it runs out of dates. Since the TimezoneOffset for the targetdate is set to be in the central time zone, using it in the calculation should yield the same result from anywhere in the world. The date displayed in the calculated target date shows the TimezoneOffset based on your location, but this is a corrected time from the central time zone. This is why the kickoff time shown is actually correct for your specific time zone. For example Central Standard Time (CST) is UTC-6., but during Daylight Savings Time it becomes Central Daylight Time (CDT) and is set to UTC-5. I have attempted to fix this by comparing the TimezoneOffset between now (the current date) and the target date and using different calculations to set dstfix depending on the results of the comparison. dsttarget = targetdate.getTimezoneOffset()/60; AnabolicEnergy if (dsttarget == dstnow) dstfix = (0); else if (dsttarget > dstnow) dstfix = (-1); else if (dsttarget < dstnow) dstfix = (1); nowfix = (now * 1 - dstfix * 60 * 60 * 1000); Now is multiplied by 1 in the nowfix calculation so that now will be calculated as a value. For the Central Time Zone: If today was 01/01/2007 (CST or UTC=6) and the next game was on 09/01/2007 (CDT or UTC=5), then dsttarget < dstnow and 1 hour is subtracted from now. If today was 11/03/2007 (CDT or UTC=5) and the next game was 11/10/2007 (CST or UTC=6), then dsttarget > dstnow and -1 hour is subtracted from now (subtracting -1 is the same as adding 1). For additional information on Time Synchronization, see http://www.tburke.net/info/misc/time_synchronization.htm |