Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove milliseconds from datetime js

//You can just fetch hours, minutes and seconds..rather than removing milisecond
var myDate = new Date();
var hour = myDate.getHours();
var minute = myDate.getMinutes();
var seconds = myDate.getSeconds();
console.log(`${hour}:${minute}:${seconds}`); //15:27:35
 
PREVIOUS NEXT
Tagged: #remove #milliseconds #datetime #js
ADD COMMENT
Topic
Name
2+7 =