showing results for - "javascript check if time is less than"
Enrico
26 May 2016
1// Compare two dates (times) in JS
2const ONE_DAY = 86400000;
3
4const today = new Date();
5const yesterday = new Date(Number(today) - ONE_DAY);
6console.log(yesterday < today); // true