Lodash _.isDate() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Lang

Definition

Checks if value is classified as a Date object. It does not parse strings or timestamps — only type-checks. Since Lodash 0.1.0.

Pass the value you want to inspect or convert. Read the return type carefully before you use the result.

Syntax

Call _.isDate. Start with this line.

Lodash
_.isDate(value)
CallWhat it does
_.isDate(value)Primary signature.

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

Library declarations
Lodash
_.isDate(value)

Parameters

ParameterDescription
valueRequired. The value to check

Return Value

Return ValueDescription
*true if Date object, else false

Lodash Examples

Example 1 — Official: Real Date

A constructed Date passes the check.

Lodash
_.isDate(new Date);
// → true
Try It Yourself

How It Works

  1. Create. new Date builds a Date instance (now).
  2. Tag. Lodash sees [object Date].
  3. Result. true.
  4. Same for new Date(0) or new Date("2024-01-01").

Example 2 — Official: Date-Looking String

A string is never a Date until you parse it.

Lodash
_.isDate("Mon April 23 2012");
// → false
Try It Yourself

How It Works

  1. Input. A human-readable date string.
  2. Type. Still a string — Lodash does not parse it.
  3. Result. false.
  4. Fix. _.isDate(new Date("Mon April 23 2012")) → true.

Example 3 — ISO String and Timestamp

Common API shapes that are not Date objects yet.

Lodash
_.isDate("2024-06-01");
// → false

_.isDate(1717200000000);
// → false

_.isDate(new Date(1717200000000));
// → true
Try It Yourself

How It Works

  1. ISO string → string type → false.
  2. Millisecond number → number type → false.
  3. Wrap with new Date(…) to get a Date.
  4. Then _.isDate returns true.

Example 4 — Invalid Date Is Still a Date

Type check passes; calendar validity needs a second step.

Lodash
var bad = new Date("???");

_.isDate(bad);
// → true

Number.isNaN(bad.getTime());
// → true  (not a real instant)
Try It Yourself

How It Works

  1. Parse fails → engine still returns a Date object.
  2. isDate only checks the type tag → true.
  3. getTime() is NaN for Invalid Date.
  4. Pair both checks when APIs must reject bad dates.

Example 5 — Helper: Date and Valid Instant

Combine type check with a finite timestamp.

Lodash
function isValidDate(value) {
  return _.isDate(value) && !Number.isNaN(value.getTime());
}

isValidDate(new Date());
// → true

isValidDate(new Date("???"));
// → false

isValidDate("2024-06-01");
// → false
Try It Yourself

How It Works

  1. isDate gates the type.
  2. getTime() gates a real millisecond value.
  3. Invalid Date fails the second check.
  4. Strings fail the first check until parsed.

Browser & Runtime Support

_.isDate is a Lodash Lang helper (since 0.1.0). It runs anywhere Lodash runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash. Date itself is a core ECMAScript built-in.

✓ Stable · Lodash 0.1.0+

_.isDate()

Available in [email protected] full builds and the lodash/isDate modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.

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
_.isDate Lodash 0.1.0+

Bottom line: Safe for production once Lodash is loaded. Prefer import isDate from "lodash/isDate" for smaller builds.

Frequently Asked Questions

_.isDate(value) returns true if value is classified as a Date object, otherwise false. It does not parse strings or numbers into dates.
No. "2024-06-01" is still a string. Parse with new Date(...) first if you need a Date object.
No. An Invalid Date from new Date("???") is still a Date object, so _.isDate returns true. Check Number.isNaN(d.getTime()) for real instants.
Both usually agree. Lodash uses the object’s internal tag, which can be more consistent across realms (iframes) than instanceof alone.
No. Numbers stay numbers. Use new Date(ms) if you need a Date instance first.
Use import isDate from "lodash/isDate" or require("lodash/isDate") for tree-shaking. Full build: import _ from "lodash" then _.isDate.

Next: _.isElement()

Check whether a value is a real DOM element node.

_.isElement() 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.

11 people found this page helpful