Python datetime时区问题

  sre

5fffa4602d0a05151.jpg_fo742.png

import pytz
import datetime

def cn_time():
    """
    chinese time
    https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
    """
    return datetime.datetime.now(pytz.timezone('Asia/Shanghai'))

LEAVE A COMMENT

Captcha Code