var Milliseconds = varDate.getTime(); Milliseconds = Milliseconds - 1000 * 60 * 60 * 24;// * Days; var ResultDate = new Date(); ResultDate.setTime(Milliseconds); return ResultDate.getVarDate();