Example 1 — Read the UTC Day of the Month
Build a UTC instant with Date.UTC, then call getUTCDate().
const d = new Date(Date.UTC(2026, 2, 15)); // Mar 15, 2026 UTC
console.log(d.getUTCDate()); // 15 How It Works
- Build a UTC date.
Date.UTC(2026, 2, 15)means year 2026, month index2(March), day15in UTC. - Wrap it in
Date.new Date(...)stores that instant. - Read the UTC day.
getUTCDate()returns15. - No side effects. The
Dateis unchanged;getUTCDateonly reads.

