#P8748. Time Display Conversion
Time Display Conversion
Time Display Conversion
Cooperate with your friend to display the current time on a website. The server provides the current time as an integer representing the number of milliseconds elapsed since January 1, 1970, 00:00:00. Your task is to compute and display only the hour, minute, and second components, discarding the date and the millisecond part.
Let the input integer be denoted as (ms). First, convert (ms) to seconds by performing an integer division by 1000, i.e., (\text{total_seconds} = \lfloor \frac{ms}{1000} \rfloor). Then determine the hours, minutes, and seconds as follows:
[
\text{hours} = \left(\left\lfloor \frac{\text{total_seconds}}{3600} \right\rfloor\right) \mod 24, \quad \text{minutes} = \left(\left\lfloor \frac{\text{total_seconds} \mod 3600}{60} \right\rfloor\right), \quad \text{seconds} = \text{total_seconds} \mod 60.
]
Finally, output the time in the format HH:MM:SS, ensuring each component is two digits with a leading zero if necessary.
inputFormat
The input consists of a single integer representing the number of milliseconds elapsed since January 1, 1970, 00:00:00.
outputFormat
Output the time corresponding to the given milliseconds as a string in the format HH:MM:SS, where HH is hours (00 to 23), MM is minutes (00 to 59), and SS is seconds (00 to 59).
sample
0
00:00:00