Lodash _.now() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Date

Definition

Gets the timestamp of the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). Part of Lodash 4.x Date (since 2.4.0).

Use the syntax and examples below. Prefer performance.now() only when you need high-resolution browser benchmarks.

Syntax

Call _.now. Start with this line.

Lodash
_.now()
CallWhat it does
_.now()Primary signature.
_.now()Takes no arguments.

Prefer import now from "lodash/now" when you want a smaller bundle.

Library declarations
Lodash
_.now()

Parameters

This method has no parameters.

Return Value

Return ValueDescription
*Number — ms since Unix epoch (UTC)

Lodash Examples

Example 1 — Current Timestamp

Read milliseconds since the Unix epoch.

Lodash
_.now();
// → 1730000000123   (example — your number will differ)
Try It Yourself

How It Works

  1. Call. _.now() takes no arguments.
  2. Clock. Lodash reads Date.now() under the hood.
  3. Result. A number in milliseconds since 1970-01-01 UTC.
  4. Use. Store as createdAt, logs, or cache keys.

Example 2 — Same as Date.now()

Numerically identical to the native helper.

Lodash
_.now() === Date.now();
// → true   (same millisecond when called back-to-back)
Try It Yourself

How It Works

  1. Wrapper. Lodash forwards to the global Date.now.
  2. Equal. Same clock → same millisecond value when called together.
  3. Why Lodash? Consistent style next to other _. helpers, or modular lodash/now.
  4. Either works. Pick one style and stay consistent in a file.

Example 3 — Measure Elapsed Time

Subtract two stamps to get a duration in milliseconds.

Lodash
var start = _.now();
// … do work …
var end = _.now();

end - start;
// → e.g. 4
Try It Yourself

How It Works

  1. Start. Capture _.now() before the work.
  2. End. Capture again after the work.
  3. Subtract. Difference is elapsed wall-clock ms.
  4. Caveat. System clock can jump; use performance.now() for precise UI timings.

Example 4 — Official: Time a Deferred Call

Pass a start stamp into _.defer, then subtract inside the callback.

Lodash
_.defer(function (stamp) {
  console.log(_.now() - stamp);
}, _.now());
// → logs ms until the deferred function ran
Try It Yourself

How It Works

  1. Stamp. _.now() is passed as an argument to the deferred function.
  2. Defer. _.defer runs the function after the current call stack.
  3. Diff. Inside the callback, _.now() - stamp is the wait time.
  4. Docs idea. Same pattern as the official Lodash example.

Example 5 — Convert Stamp to a Date

Build a Date object from the millisecond number.

Lodash
var stamp = _.now();
var d = new Date(stamp);

d.toISOString();
// → "2026-10-05T06:30:00.123Z"   (example)
Try It Yourself

How It Works

  1. Stamp. _.now() returns a number.
  2. Wrap. new Date(stamp) creates a Date for that instant.
  3. Format. Use toISOString() or locale formatters for display.
  4. Round-trip. d.getTime() returns the same millisecond value.

Browser & Runtime Support

_.now is a Lodash 4.x Date helper (since 2.4.0). It requires Date.now, available in all modern browsers and current Node LTS when Lodash is installed.

✓ Stable · Lodash 2.4.0+

_.now()

Available in [email protected] full builds and the lodash/now modular import. Works wherever Date.now works — evergreen browsers and Node / Bun / Deno with Lodash.

100% With Lodash 4.x
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
_.now Lodash 4.x+

Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import now from "lodash/now" for smaller builds. Equivalent to native Date.now() — use either consistently.

Frequently Asked Questions

_.now() returns the number of milliseconds elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). It takes no arguments.
Yes. In Lodash 4.x, _.now is implemented as root.Date.now(), so the numeric result matches the native clock.
Use _.now() / Date.now() for wall-clock stamps (createdAt, logs). Prefer performance.now() for short browser benchmarks — it is monotonic and higher resolution.
No. Always call _.now() with an empty argument list.
Use import now from "lodash/now" or require("lodash/now") for tree-shaking. Full build: import _ from "lodash" then _.now().
Yes — anywhere Date.now exists (modern Node and browsers).

Next: _.defer()

Run a function after the current call stack — used in the official _.now timing example.

_.defer() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful