javascript time with hour and minute code example
Example 1: how to show only time in hours and minutes only in javascript
function prettyDate2(time) {
var date = new Date(parseInt(time));
return date.toLocaleTimeString(navigator.language, {
hour: '2-digit',
minute:'2-digit'
});
}
Example 2: new Date() get speicifc hours min sec
new Date().getDate()
new Date().getDay()
new Date().getFullYear()
new Date().getHours()
new Date().getMilliseconds()
new Date().getMinutes()
new Date().getMonth()
new Date().getSeconds()
new Date().getTime()