Skip to main content
function isDate
isDate(object: unknown): object is Date
Deprecated

Returns true if the given object is a Date. Otherwise, returns false.

import util from 'node:util';

util.isDate(new Date());
// Returns: true
util.isDate(Date());
// false (without 'new' returns a String)
util.isDate({});
// Returns: false

Parameters

object: unknown

Return Type

object is Date
Back to top