I need to be able to round the time to the next 5 minutes.
Time 11:54 - hours 11:55
Time 11:56 - hours 12:00
He can never round always always until the next time.
I am using this code at the moment, but it will also be rounded
var time = 1000 * 60 * 5;
var date = new Date();
var rounded = new Date(Math.round(date.getTime() / time) * time);
source
share