from time import gmtime, strftime import time print("\nGMT: "+time.strftime("%a, %d %b %Y %I:%M:%S %p %Z", time.gmtime())) print("Local: "+strftime("%a, %d %b %Y %I:%M:%S %p %Z\n"))