Answers for "datetime now with timezones"

0

datetime now with timezones

from pytz import timezone
from datetime import datetime

UTC = timezone('Asia/Kolkata')

def time_now():
    return datetime.now(UTC)
    
print(time_now())
Posted by: Guest on July-26-2021

Browse Popular Code Answers by Language