Date.prototype.setUTCFullYear() changes the year for this date according to universal time (UTC), and optionally the month and day (MDN). It mutates the Date in place and returns the new timestamp.
Remember
date.setUTCFullYear(year)
date.setUTCFullYear(year, month)
date.setUTCFullYear(year, month, day)
year: four-digit UTC year (e.g. 1997)
month: 0 … 11 (optional; Jan = 0)
day: 1 … 31 (optional; requires month)
→ returns new timestamp (ms)
→ mutates date
setUTCFullYear(1975) // keep month/day
setUTCFullYear(2030, 6, 20) // Jul 20, 2030 UTC
setUTCFullYear(2025) on Feb 29 → Mar 1, 2025 UTC
Syntax
Call date.setUTCFullYear. Start with this line.
JavaScript
date.setUTCFullYear(y[, m[, day]])
Call
What it does
date.setUTCFullYear(y[, m[, day]])
Primary signature.
date.setUTCFullYear(...)
Call with the arguments your case needs.
Built into JavaScript. Call setUTCFullYear(...) on a Date instance — no import required.
Library declarations
JavaScript
date.setUTCFullYear(y[, m[, day]])
Parameters
Parameter
Description
yearValue
Required. UTC four-digit year
monthValue
Optional. UTC month 0–11; keep current if omitted
dateValue
Optional. UTC day 1–31; requires monthValue
Return Value
Return Value
Description
*
The value returned by date.setUTCFullYear().
JavaScript Examples
Example 1 — Set the UTC Year Only
MDN: the offset string is already Jan 1 UTC; change only the year.
Engine normalizes. Invalid Feb 29 rolls to March 1.
Watch for this when shifting birthdays or schedules across years.
Compatibility
Browser & Runtime Support
Date.prototype.setUTCFullYear() is part of the language from early ECMAScript and is Baseline Widely available (MDN).
✓ Baseline · Widely available
Date.prototype.setUTCFullYear()
Supported in every modern browser and Node.js. No polyfill needed for ordinary web apps.
99%Modern browser support
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
Date.setUTCFullYear()Excellent
Bottom line: Safe everywhere. Focus on mutation, zero-based months, leap-day normalization, and UTC vs local choice.
Frequently Asked Questions
It sets the four-digit year of a Date according to UTC. Optional month (0–11) and day arguments can update the full UTC calendar date. The Date mutates in place and returns epoch milliseconds.
setFullYear() changes the local calendar year. setUTCFullYear() changes the UTC calendar year. They can differ near timezone midnight boundaries.
Yes. setUTCFullYear(year, month, day) updates all three. If you pass day, you must also pass month (MDN).
JavaScript normalizes the date. Feb 29, 2024 UTC + setUTCFullYear(2025) becomes March 1, 2025 UTC.
No. It returns a number (epoch milliseconds). Call setters on the Date variable — do not chain on the return value.
Out-of-range months overflow into other years. For example, month 15 becomes year+1 and month 3 (MDN).