MCPcopy Create free account
hub / github.com/codemistic/Web-Development / getTime

Function getTime

Analog_clock/index.js:5–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3let hoursHand = document.querySelector(".hours-hand");
4
5function getTime(){
6 let now = new Date();
7 let seconds = now.getSeconds()
8 let minutes = now.getMinutes()
9 let hours = now.getHours()
10
11 let timeInterval = 6;
12
13 secondsHand.style.transform = 'rotate(' + (seconds * timeInterval) + 'deg)';
14 minutesHand.style.transform = 'rotate(' + (minutes* timeInterval + seconds/10) + 'deg)';
15 hoursHand.style.transform = 'rotate(' + (hours*30 + minutes/2) + 'deg)';
16
17}
18setInterval(getTime, 100)
19

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected