Chapter 10Time and Date in JavaScript

Working with times and dates is a very common task in web programming. There are a host of scenarios where you will need to use time and date data, such as determining the current date, having the user enter dates for particular items, and even creating online calendars. In this chapter we will explore the time and date functionality built into JavaScript. You will also be shown how to create useful additions to your web page using JavaScript’s date and time functions.

The Date Object

Fortunately for JavaScript programmers, JavaScript comes with a built-in Date object that allows you to easily work with date and time data and related functions. Both dates and times in JavaScript are derived from the Date ...

Get Advanced Javascript, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.