How would you go about determining how many minutes until midnight of the current day using javascript?
function minutesUntilMidnight() { var midnight = new Date(); midnight.setHours( 24 ); midnight.setMinutes( 0 ); midnight.setSeconds( 0 ); midnight.setMilliseconds( 0 ); return ( midnight.getTime() - new Date().getTime() ) / 1000 / 60; }
2.1m questions
2.1m answers
60 comments
57.0k users