The current time can be read with the second(), minute(), and hour() functions. This example uses map() to calculate the angle of the hands. It then uses transformations to set their position.
Clock by p5.js Contributors and the Processing Foundation is licensed under CC BY-NC-SA 4.0.