Date.prototype.getUTCMilliseconds() returns the milliseconds for this date as an integer 0–999 according to universal time (UTC) (MDN). It is read-only and does not change the Date.
Remember
date.getUTCMilliseconds()
→ integer 0 … 999 (UTC)
→ NaN if the Date is invalid
Example (MDN):
new Date("2018-01-02T03:04:05.678Z").getUTCMilliseconds() → 678
getUTCMilliseconds() → UTC fraction
getMilliseconds() → local fraction
getTime() → full epoch milliseconds
Syntax
Call date.getUTCMilliseconds. Start with this line.
JavaScript
date.getUTCMilliseconds()
Call
What it does
date.getUTCMilliseconds()
Primary signature.
date.getUTCMilliseconds(...)
Call with the arguments your case needs.
Built into JavaScript. Call getUTCMilliseconds(...) on a Date instance — no import required.
Library declarations
JavaScript
date.getUTCMilliseconds()
Parameters
This method has no parameters beyond those shown in the signature.
Return Value
Return Value
Description
*
The value returned by date.getUTCMilliseconds().
JavaScript Examples
Example 1 — Read the UTC Milliseconds
Call getUTCMilliseconds() on fixed UTC instants (MDN-style).
JavaScript
const exampleDate = new Date("2018-01-02T03:04:05.678Z");
const zero = new Date(Date.UTC(2026, 0, 1, 12, 0, 0, 0));
console.log(exampleDate.getUTCMilliseconds()); // 678
console.log(zero.getUTCMilliseconds()); // 0
ISO with Z. The .678 part is the UTC millisecond field.
Read.getUTCMilliseconds() returns 678.
Date.UTC. The last argument sets UTC ms — here 0.
No mutation. The Date values are unchanged.
Example 2 — getUTCMilliseconds() vs getMilliseconds()
UTC and local fractions often match; use the UTC getter for timezone-free code.
JavaScript
const d = new Date("2018-01-02T03:04:05.678Z");
console.log(d.getUTCMilliseconds()); // 678
console.log(d.getMilliseconds()); // usually 678 (local fraction)
Contrast.getTime() is the full epoch number — not a 0–999 field.
Tip. For ready-made UTC strings, prefer toISOString().
Compatibility
Browser & Runtime Support
Date.prototype.getUTCMilliseconds() is part of the language from early ECMAScript and is Baseline Widely available (MDN).
✓ Baseline · Widely available
Date.prototype.getUTCMilliseconds()
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.getUTCMilliseconds()Excellent
Bottom line: Safe everywhere. Focus on UTC vs local choice and invalid-Date checks rather than feature detection.
Frequently Asked Questions
An integer from 0 to 999 representing the milliseconds within the current second according to UTC. Invalid Dates return NaN.
getUTCMilliseconds() returns only the 0–999 sub-second fraction in UTC. getTime() returns the full count of milliseconds since the Unix epoch.
getUTCMilliseconds() uses UTC. getMilliseconds() uses local time. For most instants they match; prefer the UTC getter when your code should ignore the host timezone.
NaN. Validate with Number.isNaN(date.getTime()) before using the result.
No. Subtract getTime() values, or use Date.now() / performance.now(). getUTCMilliseconds() only reads the fraction inside one UTC second.
No. The range is 0–999. Overflow carries into the UTC seconds field automatically.