# How to make the hour and minute hands rotate according to the real time

**URL:** <https://discourse.processing.org/t/how-to-make-the-hour-and-minute-hands-rotate-according-to-the-real-time/19994>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [April 21, 2020, 9:05am UTC](https://discourse.processing.org/t/how-to-make-the-hour-and-minute-hands-rotate-according-to-the-real-time/19994 "2020-04-21T09:05:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gravic216](https://avatars.discourse-cdn.com/v4/letter/g/f14d63/32.png) [@Gravic216](https://discourse.processing.org/u/Gravic216)\
**Post date:** [April 21, 2020, 9:05am UTC](https://discourse.processing.org/t/how-to-make-the-hour-and-minute-hands-rotate-according-to-the-real-time/19994/1 "2020-04-21T09:05:36Z")

</div>

How to make the hour and minute hands rotate according to the real time, I refer to the example of the clock provided on the website （ [https://p5js.org/zh-Hans/examples/input-clock.html](https://p5js.org/zh-Hans/examples/input-clock.html) ） When I brought the code into it and this problem was happen, how to solve it, or any other way, thank you. This is my homework 😵

 ![WechatIMG388](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/4d0258200fe24c1efd8adb43157788f13c63dabd.jpeg)

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [April 21, 2020, 11:30am UTC](https://discourse.processing.org/t/how-to-make-the-hour-and-minute-hands-rotate-according-to-the-real-time/19994/2 "2020-04-21T11:30:32Z")

</div>

Can you show your code?

I am not sure I understand your question.

Does the example not work?

---

<div class="post-metadata">

**Author:** ![Gravic216](https://avatars.discourse-cdn.com/v4/letter/g/f14d63/32.png) [@Gravic216](https://discourse.processing.org/u/Gravic216)\
**Post date:** [April 21, 2020, 11:38am UTC](https://discourse.processing.org/t/how-to-make-the-hour-and-minute-hands-rotate-according-to-the-real-time/19994/3 "2020-04-21T11:38:34Z")

</div>

Thank u I have done it, I just forget some codes

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 3, 2020, 5:17pm UTC](https://discourse.processing.org/t/how-to-make-the-hour-and-minute-hands-rotate-according-to-the-real-time/19994/4 "2020-05-03T17:17:30Z")

</div>

I see many copies of the second hand. Looks like the problem was that you didn’t call `background(255)` to clear the screen each time.
