Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript date set hours minutes seconds to 0

// dateString is for example "Fri, 26 Sep 2014 18:30:00 GMT"
function getFormattedDate(dateString) {
   var date = new Date(dateString);
   date.setHours(0, 0, 0);   // Set hours, minutes and seconds
   return date.toString();
}
 
PREVIOUS NEXT
Tagged: #javascript #date #set #hours #minutes #seconds
ADD COMMENT
Topic
Name
3+5 =