Answers for "javascript check if time is less than"

1

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
Posted by: Guest on July-14-2021

Code answers related to "javascript check if time is less than"

Code answers related to "Javascript"

Browse Popular Code Answers by Language