var d = new Date(1673366309); 2 var formattedDate = d.getDate() + "-" + d.getMonth() + "-" + d.getFullYear(); 3 var hours = (d.getHours() < 10) ? "0" + d.getHours() : d.getHours(); 4 var minutes = (d.getMinutes() < 10) ? "0" + d.getMinutes() : d.getMinutes(); 5 var formattedTime = hours + ":" + minutes; 6 formattedDate = formattedDate + " " + formattedTime; 8 9 alert(formattedDate);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter