i want to get the prvious round 15 minutes from a given time or date in js for example i have 11:20 i want to get 11:15 , 12:57 i want to get 12:45 , i tried this :
var round = 1000 * 60 * 15;
var date = new Date()
console.log(date)
var rounded = new Date(Math.round(date.getTime() / round) * round)
but this give me the nearest 15 minutes not the previous , for 15:57 for example it give me 16:00 when i want to get 15:45 any solution ?