The 24-hour clock is the convention of time keeping in which the day runs from midnight to midnight and is divided into 24 hours, indicated by the hours passed since midnight, from 0 to 23. This system is the most commonly used time notation in the world today, and is the international standard notation (ISO 86011) for time of day.

24-uursklok
24-hour clock that indicates the time 23:30:45.

A time of day is written in the 24-hour notation in the form hh:mm:ss (for example, 01:23:45), where hh (00 to 23) is the number of full hours that have passed since midnight, mm (00 to 59) is the number of full minutes that have passed since the last full hour, and ss (00 to 59) is the number of full seconds that have passed since the last full minute. A leading zero is added for numbers that are less than 10. In the 24-hour time notation, the day begins at midnight (00:00:00) and the last second of the day falls at 23:59:59.

Assignment

Define a class Clock that can be used to represent 24-hour clocks in Python. The class Clock must at least support the following methods:

Example

>>> clock = Clock()
>>> clock
Clock(0, 0, 0)
>>> print(clock)
00:00:00

>>> clock.set(hours=7, minutes=5, seconds=41)
>>> clock
Clock(7, 5, 41)
>>> print(clock)
07:05:41

>>> clock.forward(minutes=57, seconds=39)
>>> print(clock)
08:03:20

>>> clock.forward(hours=20, minutes=8, seconds=48)
>>> print(clock)
04:12:08