Time & Date JavaScript Code Snippets

These snippets 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 snippets 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 snippets.

Results via Envato Market

Despite what many believe, the first day of the new millenium begins on January 1st, 2001, *not* 2000… which is why I wrote this clock. This script may be freely distributed so long as it remains unchanged. (Nav and IE compatible.)

This is a clock that displays the time and date. It uses 11 images, so make sure you get them all. It was designed specifically for Microsoft Internet Explorer and will not show up in other browsers (it won’t give errors in other browsers though).

This JavaScript write the date in the following format: Weekday, Month, and Day. You can add the Year if you want. You can also change the font size, color, and type.

Shows the time in Biel Mean Time (Internet Time) as well as Greenwich Mean Time, with the time zone difference in parenthesis.

Calculates sunrise/sunset and twilight times for any place and any date 1901-2099. Now with a form for user input.