xxxxxxxxxx
35
function setup() {
createCanvas(400, 400);
//rectMode(CENTER);
angleMode(DEGREES);
noStroke()
}
function draw() {
background(255);
let h = hour();
let m = minute();
let s = second();
//rect(width/2,height/2,s*5);
translate(width/2, height/2);
rotate(-90);
//second
fill(255,255,0,80);
arc(0,0,400,400,0,s*6);
//minute
fill(204,204,255,80);
arc(0,0,350,350,0,m*6);
//hour
fill(204,255,245,80);
arc(0,0,300,300,0,h*15);
console.log(`it is ${h}:${m}:${s} o'clock`)
}