Time and Date Scripts
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.
-
Stop Watch = Elapsed Time + Clock by Robert Ernster
Stop Watch times any event in days : hours : minutes : seconds.
-
Calendar by Anup Khandelwal
If you need a simple, elegant calendar to display the current days of the month, Basic Calendar is an excellent script for the purpose. Uses CSS to allow easy changing to its appearance, everything from calendar dimensions, colors, down to the font used to highlight the current day.
-
Alarm by Divyanshu Kalra
Set a alarm!
-
Good Morning, Afternoon, and Evening by Brad Jones
Adjust your message based on the time. See an example of saying Good Morning, Good Afternoon, or Good Evening based on the time of the day.
-
Determine Page Update Date by Brad Jones
Automatically display the date when the page was last updated. This super simple JavaScript call will give you that date.
-
Auto Expire
"Set ""go live"" and ""expire"" dates for content, such as ""Latest News"" or various promotional content."
-
Dynamic Timed Redirect
Redirect the user to a different Web page after a designated number of seconds.
-
Button Ticker
This is a cross browser javascript button ticker that ticks a number of messages on a button.
-
Date and Time of Last Visit
Display the date and time of the users last visit.
-
Double StopWatch
This script uses two stopwatches, one in seconds and one in ms.
-
Auto Expire
"Set ""go live"" and ""expire"" dates for content, such as ""Latest News"" or various promotional content."
-
Basic Date Display
Display today's date on your page.
-
Basic Date Display
Use this code snippet to display today's date on your Web page.
-
Month Page
The script determines the current month and sends them to the correct page.
-
Time Picker with child window
This JavaScript code - date picker helps you choose a time through a popup window. Perhaps this feature is not new, but you can customize this calendar control code to create new effects that require the controls through another window page.
-
Born on This Day
What day of the week you were born on?
-
Time of Day Picture Change
Change a picture based on the time.
-
Time Spent on Page
Show your visitors how long they've been on your page!
-
Simple Date Format library
This library can help you format a date object to a string or vice versa by very simple functions.
-
Day of Week
Use this script to calculate what day of the week a given date occurred. Can be used for past or future dates.
-
Reoccurring Events Monthly Calendar
Features include one time, weekly, monthly, and annual events. Monthly navigation uses links or a dropdown list.
-
Auto Expire
Set "go live" and "expire" dates for content, such as "Latest News" or various promotional content. Great for when you don't have time to remember to go back and take old content down, or when you want to create content and have it go live at a later date.
-
End of Week Date Lookup
Use this script to display the date of the end of the week for any given period during the year. Fully customizable and easy to use.
-
Check for Leap Year
This snippet will check whether a date belongs to a leap year. Easy to add to an existing script.
-
Time of Day Picture Change
Use this script to change a picture (or banner) depending on the time of the day. Very simple to use!



