Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to verify timestamp format in javascript

var valid = (new Date(timestamp)).getTime() > 0;

var valid = (new Date('2012-08-09')).getTime() > 0; // true
var valid = (new Date('abc')).getTime() > 0; // false
Comment

PREVIOUS NEXT
Code Example
Javascript :: chess 
Javascript :: localstorage set item 
Javascript :: js merge 2 lists 
Javascript :: method to look for objects in arrays by id 
Javascript :: get text from selected select javascript object 
Javascript :: node js catch any errors 
Javascript :: promise in forloop 
Javascript :: format date js 
Javascript :: local string method 
Javascript :: create file if not exists nodejs 
Javascript :: the path argument must be of type string. received undefined react 
Javascript :: node js starting template 
Javascript :: cannot find module @babel/compat-data/data/corejs3-shipped-proposals 
Javascript :: arrondi js 
Javascript :: if back react 
Javascript :: cypress get element val and return it 
Javascript :: react apexcharts pie props 
Javascript :: javascript change url 
Javascript :: js math.random 
Javascript :: jquery checkbox listener not working on programmatically change 
Javascript :: set header as json in laravel 
Javascript :: javascript change input value event 
Javascript :: object inside object javascript 
Javascript :: js reduce break 
Javascript :: react native indicator 
Javascript :: replace space with hyphen/dash javascript 
Javascript :: regexp constructor javascript 
Javascript :: append meta tag to head javascript 
Javascript :: flatlist scrolltoend 
Javascript :: js random string from array 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =