Here's a way to get the current time in seconds:
let currentTimeInSeconds = new Date().getTime() / 1000;
I have an array containing objects with an expirationDate
property that returns expiration time in seconds. I can find the bills that have expired, but I want to exclude the ones expiring today.
this.ExpiringTodayBills = this.UnpaidDuebills.filter(bill => bill.paid === false && bill.expirationDate === currentTimeInSeconds);
The code above isn't effective because the current time is always changing due to hours, minutes, seconds, and milliseconds.
Is there a way to compare expirationDate to today without considering the exact time?
Edit: Here is an example of a bill
name: Test bill
paid: false
expirationDate: 1535598000 (equivalent to August 30, 2018, 3:00:00 AM)
amount: $231.33