📜  datetime 现在带有时区 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:31.241000             🧑  作者: Mango

代码示例1
from pytz import timezone
from datetime import datetime

UTC = timezone('Asia/Kolkata')

def time_now():
    return datetime.now(UTC)
    
print(time_now())