Dates
Working with dates and times in JavaScript using the Date object and Intl.DateTimeFormat.

Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026

The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.


Working with dates can be complicated. No matter the technology, developers do feel the pain.

JavaScript offers us a date handling functionality through a powerful built-in object: Date.

In this unit, you’ll learn:

  1. Date basics - Creating dates, the Date object, and timestamps
  2. Getting date parts - Extracting year, month, day, hour, and more
  3. Date formatting - How to format dates for display using built-in methods and Intl.DateTimeFormat
  4. Date math - Adding/subtracting days, counting days between dates, getting tomorrow and yesterday
  5. Date comparisons - Checking if a date is today, in the past, or the same day as another date
  6. Date recipes - Common patterns like sorting arrays by date, getting timestamps, and more

Lessons in this unit:

0: ▶︎ Introduction
1: Date Basics
2: Getting Date Parts
3: Date Formatting
4: Date Math
5: Date Comparisons
6: Date Recipes