How do I check a date is actually today (the same date) rather than the difference between hours in a day?
I have three timestamps as examples, one is today (22/07/1
You can try this,
var today = 1406019110000; // today
var yesterday = 1405951867000; // yesterday
checkToday(today);
checkToday(yesterday);
function checkToday(timestamp)
{
if (moment(timestamp).format('DD/MM/YYYY') == moment(new Date()).format('DD/MM/YYYY'))
alert('true');
else
alert("false");
}
Here is the demo