WebSiteMadeEasy.net
|
FontsMadeEasy.com
|
RankChecker.net
Google Search:
Learn Java Script Today
|
Over 5000 Free Fonts
|
Tutorials
|
Javascript Forum
|
Other Javascript Resources
|
Cheat Sheet
JavaScript Basics
Inserting Javascript
Complete Tutorial
Advance DHTML Tutorial
Script archive
Advance Tutorials
Alert Scripts
Animation
Audio
Background Effects
Banner Ads
Browser Window
Buttons
Button Forms
Calculcators
Calendars
Clocks & Dates
Cookies
Cursor Effects
DHMTL Games
DHTML Miscellaneous
Equivalents
Forms
Games
IE4+ Scripts
IE5+ Scripts
Image Effects
Image Miscellaneous
Links & Buttons
Math Related
Messages Miscellaneous
Miscellaneous
Mouse Tricks
Navigation
Page Details
Password Protection
Pulldown Menus
Random Stuff
Scrolling
Status Bar
Text Animation
User Detail
User Info
Window Control
Days Till Date
This little JavaScript will take an event or date in the future and compare it to the current date, then display how many days until that date/event occurs. Pretty neat! Lots of uses... (Marriage countdown, till school's out countdown, etc)
Insert into <HEAD>
Insert into <BODY>
<SCRIPT LANGUAGE="JavaScript"> <!-- Original: Alan Palmer --> <!-- Web Site: http://www.jsr.communitech.net --> <!-- Begin var date = new Date("January 1, 2000"); var description = "the year 2000"; var now = new Date(); var diff = date.getTime() - now.getTime(); var days = Math.floor(diff / (1000 * 60 * 60 * 24)); document.write("<center><h3>") if (days > 1) { document.write(days+1 + " days until " + description); } else if (days == 1) { document.write("Only two days until " + description); } else if (days == 0) { document.write("Tomorrow is " + description); } else { document.write("It's" + description + "!"); } document.write("</h3></center>"); // End --> </script>
Other Options