Returns an integer timestamp for the current time, using the fastest method available in the runtime — useful for timing and animation (official Underscore docs).
Pass the required arguments shown below. Underscore utility helpers usually return a new value or function — check edge cases before you ship.
Syntax
Call _.now. Start with this line.
Underscore
_.now()
Call
What it does
_.now()
Primary signature.
_.now(...)
Call with the arguments your case needs.
Load Underscore with import _ from "underscore" (or the UMD CDN build) so these helpers are available as _.
Library declarations
Underscore
_.now()
Parameters
This method has no parameters beyond those shown in the signature.
Return Value
Return Value
Description
*
Integer milliseconds since epoch
Underscore.js Examples
Example 1 — Official Current Stamp
Call _.now() with no arguments. You get an integer of milliseconds.
Underscore
_.now();
// → 1392066795351 (docs sample)
// → live: current ms since epoch
typeof _.now();
// → "number"
Docs sample.1392066795351 is a fixed snapshot from the docs era.
Live value. Your run prints today’s milliseconds since the epoch.
Type. The return is a number, not a Date.
Example 2 — Measure Elapsed Time
Stamp before and after work; subtract to get milliseconds spent.
Underscore
var start = _.now();
// simulate work
var sum = 0;
for (var i = 0; i < 100000; i++) sum += i;
var elapsed = _.now() - start;
// → a small integer (ms)
elapsed >= 0;
// → true
Rule. Keep the number for storage; convert only when you need Date APIs.
Compatibility
Browser & Runtime Support
_.now ships with Underscore.js (1.6.0+). It runs anywhere Underscore runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install underscore. On modern engines it is Date.now.
✓ Stable · Underscore 1.6+
_.now()
Available in [email protected] (UMD / ESM). Works in evergreen browsers and current Node LTS when Underscore is loaded.
100%With Underscore 1.6+
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
_.nowUnderscore 1.6+
Bottom line: Safe for production once Underscore is on the page or in your bundle. Not a separate browser API — load Underscore first (or use Date.now directly). Prefer a pinned CDN version (e.g. [email protected]).
Frequently Asked Questions
_.now() returns an integer timestamp for the current time, using the fastest method available in the runtime. In modern engines that is Date.now(); otherwise it uses new Date().getTime(). The official sample is 1392066795351.
_.now() with no arguments. The docs show => 1392066795351, a sample from around February 2014 when the helper shipped. A live call prints the current milliseconds since 1970-01-01 UTC.
In current browsers and Node, yes: the source is Date.now || function(){ return new Date().getTime(); }. The number you get matches Date.now() within a millisecond or two.
Use _.now() (or Date.now()) for wall-clock stamps such as createdAt. Use performance.now() for short benchmarks: it is monotonic and higher resolution, and it counts from page load, not from 1970.
No. It returns a number (milliseconds). Wrap it with new Date(_.now()) if you need a Date object.
No. It is a stable Underscore utility added in version 1.6.0 as an optimized timestamp, used internally to speed up debounce and throttle.