Skip to content

Instantly share code, notes, and snippets.

@olivierto
olivierto / TimeClockJS.js
Last active Aug 13, 2018
TimeClockJs pour affiher une horloge en JS
View TimeClockJS.js
function updateClock ( )
{
var currentTime = new Date ( );
var currentHours = currentTime.getHours ( );
var currentMinutes = currentTime.getMinutes ( );
var currentSeconds = currentTime.getSeconds ( );
// Pad the minutes and seconds with leading zeros, if required
currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
You can’t perform that action at this time.