Time and Date Scripts - Page 2
These scripts all relate to time and dates. Some of them display only the month, others the entire year. Some highlight the current day or tell you when you entered the page. Other scripts display the current date or time according to the user's time zone, or another time zone some other place in the world. The source code is available for all the scripts.
Visit The JavaScript Forum for help coding scripts or general questions about the scripts themselves.
-
Holiday Test
This script tests to see if it is a certain holiday. If it isn't then it tests the current hour and gives the appropreiate 'good morning','good afternoon', or 'good evening' response. The big major cool thing about this script, is that it can determine Easter every year, even though Easter is based upon lunar cycles. (Repost)
-
When is Christmas
Count down dynamic clock to Christmas for both IE > 4 and Netscape > 4 . This will automatically check for leap years and adjust accordingly and also gives a nice message from xmas till Jan.1
-
script clock
A basic clock that displays as text.
-
Standard or Daylight Time
Is it Standard or Daylight time? This script fills in the correct middle letter of the time zone designation so that either an "S" is shown for Standard, or a "D" for Daylight time. The first function of the script may be used independently if you just need to know in which segment of the year a given date/time is. Adjusted for the new 2007 time changes.
-
Monthly Calendar with Reoccurring Events
Features include one time, weekly, monthly, and annual events. Monthly navigation uses links or a dropdown list. Easy to customize using CSS. Can be integrated with a server-side language to retrieve events from a database.
-
fcp.Calendar
A tiny, self-contained JavaScript library which displays a Gregorian calendar. An event is triggered when a user clicks on a date. Fully customizable via CSS. (Uses a European layout, i.e., the week begins on Monday.)
-
Countdown Timer 2
This countdown script prints directly to the page, displaying the time left in minutes and seconds. The time duration can be set in the script. The timer will automatically stop when the time reaches 00 minutes and 00 seconds.
-
Easy Time Zone Offset Calculator
Do you have your office hours posted on your contact page? Do you have regularly scheduled chats or other Internet events? Use this script to show your visitors what time that would be in their time zone.
-
Date Format
This JavaScript date library is an extension of the internal Date object, which enables various formatting of date/time values.
-
Born on This Day
Find out what day of the week you were born on. Can be customized to add other factors also.
-
Countdown Timer
This script displays a countdown timer and alerts the user when the timer reaches zero. It then redirects to another Web page. Particularly useful if you are writing an online test.
-
Gurt Calendar JavaScript
Tried, extremely fast, cross-browser calendar to enter date and time info in predicted format.
-
Date and Time of Last Visit
Display the date and time of the users last visit. Easy to implement.
-
Simple Calendar
This script displays a calendar page of the chosen month and year. The function takes a date object as its parameter. If it is omitted, the calendar will default to the date on the client computer.
-
Days Since
This script displays the number of years, months, and days since a selected event. The output can easily be formatted using CSS.
-
Basic Date Display 2
This script will display the month, day, and year, without the day of the week. Clean and simple. The display can be changed with CSS.
-
Time Spent on Page
This script displays an alert message when a page is closed, telling the visitor how long (in seconds) they have been on the page. It can also display the time on the page in the title bar.
-
Days Between Two Dates
Use this script to figure out how many days there are between two given dates. Very easy to implement.
-
Calendars : Days Remaining
Display the days remaining until a specified date. Short and effective.
-
Hawaii Date & Time
No matter which time zone you're in, this script shows you the date & time in Hawaii and your date & time in two different formats.
-
Date Generator v2.1
Answer several simple questions and you can tailor the format of the appearance of the date. Includes time-based greetings, time and date formats, military time options, wording options, line, and paragraph and centering options.
-
Event Countdown
An easy-to-use countdown script which can also count towards a specific amount of days (e.g., day 12 of 30). (Additional uses listed in script.)
-
Add Time
Use this script to add time - in the form of seconds, minutes, or hours - to the current time.
-
Clock, Day, Date
This script looks at your clock on your computer and has a clock that follows your mouse.
-
Floating Timer/Clock
It's a very customizable timer (or a clock whatever you choose) that displays how long the visitor was on your page, or displays the local current time. It always sits in one of the corners of your browser (you choose which one) when you scroll the page.

