bhylu.com

Advertisements

JS Date Get

Date has separate local and UTC getters. Pick one family consistently when reading a timestamp.

Where to run this

This example uses the JavaScript console playground. Select Run to execute it; the example does not run on this lesson page.

A practical example

JavaScript

const opening = new Date("2026-11-07T10:00:00Z");
console.log(opening.getUTCFullYear());
console.log(opening.getUTCMonth() + 1);

What happens

The year is 2026 and the month number is 11.