# Rotated analog clock [closed]

Given:

• a 12 hour time t in hours and minutes,
• a rotation r in degrees,

return the time shown when an analog clock that is displaying the time t is rotated r degrees clockwise.

After rotation, the hour hand will not line up with the new position of the minute hand. To correct for this, the new hour can be derived from the new position of the hour hand.

This is . The shortest solution wins. Standard loopholes apply.

Inspired by unmarked analog clocks like this one:

• The hour hand doesn't really line up if you rotate the whole thing. Should we be basing the hour on which hours it is between? Some test cases might be nice too
– Jo King
Commented Sep 16, 2019 at 3:09
• @JoKing I added a line to clarify Commented Sep 16, 2019 at 3:13
• How can we represent the time? A pair of integers, numbers of minutes since 1200, a native time object, a string like "0130" or "1:30"?
– Jo King
Commented Sep 16, 2019 at 4:32
• Test cases should be provided.
– Joel
Commented Sep 16, 2019 at 4:44
• This needs more clarification and some test cases. We have 360 degrees and 60 minutes, which means rotating by 6 degrees should move the minutes handle to the next minute. But what if we rotate by 3 degrees? Will it be same minute or the next minute? Commented Sep 16, 2019 at 5:23