var MILLIS_PER_DAY = 1000 * 60 * 60 * 24;var now = new Date(); var yesterday = new Date(now.getTime() - MILLIS_PER_DAY);