Time and Date Scripts - Page 2 | JavaScriptSource

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.

  • Auto Expire
    Don Demrow Aug 11, 2008

    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
    Jake Aitchison Jun 30, 2008

    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
    Apr 21, 2008

    This snippet will check whether a date belongs to a leap year. Easy to add to an existing script.

  • Time of Day Picture Change
    Mar 28, 2008

    Use this script to change a picture (or banner) depending on the time of the day. Very simple to use!

  • Holiday Test
    James Livingood Dec 20, 2007

    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
    Chris Whyte Dec 20, 2007

    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
    john <> May 27, 2007

    A basic clock that displays as text.

  • Standard or Daylight Time
    Mar 9, 2007

    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
    Shaun Bailey Mar 7, 2007

    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
    Felix Plesoianu Dec 15, 2006

    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
    Sandeep Gangadharan Nov 22, 2006

    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
    Oct 9, 2006

    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
    Sep 27, 2006

    This JavaScript date library is an extension of the internal Date object, which enables various formatting of date/time values.

  • Born on This Day
    Sep 1, 2006

    Find out what day of the week you were born on. Can be customized to add other factors also.

  • Countdown Timer
    Neill Broderick Aug 14, 2006

    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
    Gurtom Gurtom Aug 9, 2006

    Tried, extremely fast, cross-browser calendar to enter date and time info in predicted format.

  • Date and Time of Last Visit
    Patrick Clinger Jul 31, 2006

    Display the date and time of the users last visit. Easy to implement.

  • Simple Calendar
    Francis Cocharrua Jul 7, 2006

    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
    Chris Hallberg Jun 26, 2006

    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
    Lee Underwood Jun 12, 2006

    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
    Cody Shaffer Mar 22, 2006

    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
    Jan 9, 2006

    Use this script to figure out how many days there are between two given dates. Very easy to implement.

  • Calendars : Days Remaining
    Robin Jones Dec 16, 2005

    Display the days remaining until a specified date. Short and effective.

  • Hawaii Date & Time
    Raven Dec 12, 2005

    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
    Mike Dec 7, 2005

    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.