Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript check if time is less than

// Compare two dates (times) in JS
const ONE_DAY = 86400000;

const today = new Date();
const yesterday = new Date(Number(today) - ONE_DAY);
console.log(yesterday < today); // true
 
PREVIOUS NEXT
Tagged: #javascript #check #time
ADD COMMENT
Topic
Name
3+1 =