Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using Python Displaying the current time Develop proper algorithm for solving a

ID: 3709716 • Letter: U

Question

Using Python Displaying the current time

Develop proper algorithm for solving a given program. The instructions in the algorithm will serve as comments in your program

Turn the algorithm into code

The problem is to develop a program that displays the current time in Greenwich Mean Time (GMT) in the format hour:minute:second, such as 13:19:18

The time() function in the time module returns the current time in seconds with millisecond precision elapsed since the time 00:00:00 on January 1, 1970 GMT. This time is known as the UNIX epoch. The epoch is the point when time starts. 1970 was the year when UNIX operating system was formally introduced. For example, time.time() returns 1285543663.205, which means 1285543663 seconds and 205 milliseconds.

You can use this function (the time() function in the time module) to obtain the current time, and then compute the current second, minute, and hour.

Sample Run:

Current time is 17:31:8 GMT

Explanation / Answer

Hi Dear,

Please find my code.

Output:

Current time is 00:47:17 GMT

Process finished with exit code 0

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote