formating decimal hours as hours and minute javascript

Solutions on MaxInterview for formating decimal hours as hours and minute javascript by the best coders in the world

showing results for - "formating decimal hours as hours and minute javascript"
Giuseppe
14 Nov 2019
1var decimalTimeString = "1.6578";
2var n = new Date(0,0);
3n.setMinutes(+decimalTimeString * 60);
4var result = n.toTimeString().slice(0, 5);