how to get current date minus 1 day in javascript code example Example: javascript today minus 1 day var d = new Date(); d.setDate(d.getDate()-1);