Just another approach to complete the answer of JBRWilkinson but adding some code. It can also offers a solution to Alex Reynolds"s comment. Use NSCalendar method: (NSDa
var str = 1478508411000;
console.log(new Date(str).toDateString());
if (new Date(str).toDateString() === new Date().toDateString()) {
//今天
console.log("当天");
} else if (new Date(s