Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript log Time from Date

const timeFromDate = date => date.toTimeString().slice(0, 8);

console.log(timeFromDate(new Date(2021, 0, 10, 17, 30, 0))); 
// Result: "17:30:00"
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #javascript #log #Time #Date
ADD COMMENT
Topic
Name
9+9 =