var today = new Date(); today.setTime(today.getTime()); var todayStr = today.getFullYear()+"-" + (today.getMonth()+1) + "-" + today.getDate(); let date = new Date(todayStr); console.log(date.getTime()/1000)