Human readable timezone in python?

后端 未结 2 1845
小蘑菇
小蘑菇 2021-01-20 06:19

How can I get human readable timezone from these timeformat in python?

And how can I convert the same time to be in that timezone?

\'scheduled_dateti         


        
2条回答
  •  清酒与你
    2021-01-20 06:52

    import time,datetime,os
    localtime = time.asctime( time.localtime(time.time()) )
    print ("Local current time :", localtime)  #This is localtime
    
    os.environ['TZ'] = 'EST+05EDT,M4.1.0,M10.5.0'  #Here u need to specify what might be #the timezone
    time.tzset()
    print time.strftime('%X %x %Z')
    

提交回复
热议问题