offset = eval(input("Enter the time zone offset to GMT: "))
currentTime = time.time()
totalSeconds = int(currentTime)
currentSecond = totalSeconds % 60
totalMinutes = totalSeconds // 60
currentMinute = totalMinutes % 60
totalHours = totalMinutes // 60
currentHour = (totalHours % 24)
print("Current time is", currentHour,":", currentMinute,":"currentSecond,"GMT")
The task: Revise the program so that it prompts the user to enter the time zone in hours away from (offset to) GMT and displays the time in the specified time zone.
As you see, I have already prompted the user to enter the offset, but I cannot figure out what to do next. I have tried subtracting and adding offset, but will end up impossible answers like 28:00:... or -6:00:...
I am new to this stuff, so if you use any advanced (not beginner) terminology and operations, please give a brief brief explanation.
Thanks.