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
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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
