import datetime
import time
import pytz as pytz

if __name__ == '__main__':
    tz = pytz.timezone('Asia/Shanghai')  # 东八区
    t = datetime.datetime.fromtimestamp(int(time.time()), tz).strftime('%Y-%m-%d %H:%M:%S %Z%z')
    print(t)  # 2021-10-14 21:28:15 CST+0800

 

如果忍耐算是坚强 我选择抵抗 如果妥协算是努力 我选择争取