• in
InterCourses
CoursesBlogs
0
← Introduction to JavaScript
○What is JavaScript?○Your First JavaScript Code○Data Types○Type Checking
○Declaring Variables○let and const in Practice○Operators○Type Conversion
○Conditionals○Switch Statement○For Loops○While Loop○Break and Continue
○Defining Functions○Arrow Functions○Scope○Closures○Project - Calculator○Function Expressions
○Arrays○Array Mutation Methods○Array Search and Slice○Array Iteration Methods○Multidimensional Arrays○Destructuring○Array Reverse and Sort○Array Fill○Array Find and Includes○Array Flat and FlatMap○Array Reduce, Some, and Every
○Objects○Object Methods and Destructuring○JSON○Math and Date●Date Basics
○02 Template Literals○String Methods○Regular Expressions
○Higher-Order Functions○Callbacks○map, filter, and reduce○Recursion○Project - Data Transform Pipeline
○OOP Introduction○Classes○Inheritance○Encapsulation
○Asynchronous JavaScript○Promises and Async Await○Async API Simulation

Date Basics

Dates can feel noisy at first, so this lesson keeps them deterministic. A fixed UTC date lets beginners practice reading the year, month, and day without timezone surprises.

Example

javascript
const launchDate = new Date('2024-05-06T00:00:00Z');
const year = launchDate.getUTCFullYear();

Your Task

  1. Create launchDate from 2024-05-06T00:00:00Z and read the UTC year, month, and day into separate variables.
  2. Display 2024-05-06 in #output.
Hint 1
1 / 2
HINT 1

Use getUTCFullYear(), getUTCMonth() + 1, and getUTCDate() for stable results.

Loading editor…
READY
intercourses
javascript