Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check if a date time string is a valid date in js

const isValidDate = function(date) {
    return (new Date(date) !== "Invalid Date") && !isNaN(new Date(date));
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #date #time #string #valid #date #js
ADD COMMENT
Topic
Name
2+4 =