Date.UTC()

The same argument list as the multi-argument Date constructor, interpreted as UTC instead of local time. That single difference is the whole reason it exists.

Date static methodES1 (1997)Live demo
Common call
new Date(Date.UTC(2026, 2, 15))
Returns
a timestamp — wrap it for a Date
Replaces
new Date(y, m, d), which uses local time
Watch out
month is still 0-indexed, and it returns a NUMBER
Date.UTC(yearyear — The full year. Values 0 to 99 are mapped to 1900–1999, which is a legacy trap.type: number · required, month[, day[, hours[, minutes[, seconds[, ms]]]]])
→ number

Demo

Live evaluation
Try:
Inputs
yearnumberfull year
monthnumbermonth 0–11
daynumberday of the month
Output
Date.UTC(2026, 2, 15)
1773532800000

The output is a plain number, which is the first thing to notice — Date.UTC does not return a Date. The epoch case gives 0, confirming the reference point. The month argument is zero-based exactly as getMonth is, so 2 means March. Out-of-range values roll rather than fail: month 12 becomes January of the next year, and day 0 becomes the last day of the previous month, which is the standard trick for finding a month length.

Parameters

NameTypeRequiredDescription
yearnumberyesThe full year. Values 0 to 99 are mapped to 1900–1999, which is a legacy trap.
monthnumberyesZero-based, as everywhere in Date — 0 is January, 11 is December. Out-of-range values roll into the year.
daynumberno (1)One-based day of the month. 0 means the last day of the previous month. Remaining arguments default to 0.

Return value

number — A timestamp in milliseconds — NOT a Date. Wrap it in new Date() if you want an object.

Common patterns

Build a UTC date
Wrap the timestamp.
const d = new Date(Date.UTC(2026, 2, 15));
Days in a month
Day 0 of the next month.
const days = new Date(Date.UTC(y, m + 1, 0)).getUTCDate();
Deterministic tests
No dependence on the runner timezone.
const fixed = new Date(Date.UTC(2026, 0, 1));

Examples

1. A UTC timestamp
Date.UTC(2026, 2, 15)
Returns
1773532800000
2. The epoch
Date.UTC(1970, 0, 1)
Returns
0
3. It returns a number
typeof Date.UTC(2026, 2, 15)
Returns
'number'
4. One argument is the year
new Date(Date.UTC(2026)).toISOString()
Returns
'2026-01-01T00:00:00.000Z'
5. Days in March
new Date(Date.UTC(2026, 3, 0)).getUTCDate()
Returns
31
6. The constructor is local
new Date(2026, 2, 15).getTimezoneOffset() !== 0
Returns
true, outside UTC

Pitfalls

1. It returns a number, not a Date
The most common slip. Calling a Date method on the result fails, because a number has none. Wrap it in new Date() whenever you want an object.
Not a Date
Date.UTC(2026, 2, 15).toISOString()
TypeError: ...toISOString is not a function
Wrap it
new Date(Date.UTC(2026, 2, 15)).toISOString()
'2026-03-15T00:00:00.000Z'
2. The month is still zero-based
Switching from the constructor to Date.UTC fixes the timezone and changes nothing about the indexing. Passing 3 for March produces April, and the date is otherwise perfectly valid.
That is April
new Date(Date.UTC(2026, 3, 15)).toISOString().slice(0, 10)
'2026-04-15'
March is 2
new Date(Date.UTC(2026, 2, 15)).toISOString().slice(0, 10)
'2026-03-15'
3. Years 0 to 99 mean 1900 to 1999
A two-digit-year hangover. Date.UTC(26, 0, 1) is 1926, not 2026 and not year 26. Any year value that might legitimately be small needs setUTCFullYear afterwards.
Nineteen twenty-six
new Date(Date.UTC(26, 0, 1)).getUTCFullYear()
1926
Set it explicitly
const d = new Date(0);
d.setUTCFullYear(26);
d.getUTCFullYear()
26
4. The multi-argument constructor is local, this is not
new Date(2026, 2, 15) is midnight LOCAL; Date.UTC(2026, 2, 15) is midnight UTC. They are different instants everywhere except UTC itself, which is why tests written with the constructor pass in one timezone and fail in another.
Local midnight
new Date(2026, 2, 15).toISOString()
shifts with the runtime
UTC midnight
new Date(Date.UTC(2026, 2, 15)).toISOString()
'2026-03-15T00:00:00.000Z'

When to use

Use it
  • Building a date from components without local-time interference
  • Deterministic fixtures and tests
  • Finding the number of days in a month, via day 0
  • Server-side date construction
Reach for something else
  • You want a Date object → wrap the result
  • You have an ISO string → new Date(string) or Date.parse
  • You mean a local wall-clock time → the multi-argument constructor
  • Years below 100 → set the year explicitly afterwards

Notes

Complexity
O(1)
Return
A number; no Date is allocated
CPython impl
V8: Builtins-date-utc
Memory
No allocation
Thread-safe
Single-threaded

FAQ

Because it predates any convenient way to say so, and it composes with the constructor instead — new Date(Date.UTC(...)). It is a small annoyance that has been in the language since 1997.

new Date(Date.UTC(2026, 2, 15));

History

ES1
Date.UTC present from the first version, alongside the local multi-argument constructor.