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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.