Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js is date

typeof date.getMonth === 'function'
// you can use the instanceof operator, i.e. But it will return true for invalid dates too, e.g. new Date('random_string') is also instance of Date
date instanceof Date
// This will fail if objects are passed across frame boundaries.
// A work-around for this is to check the object's class via
Object.prototype.toString.call(date) === '[object Date]'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #date
ADD COMMENT
Topic
Name
3+4 =