datetime_time_zone_timedelta

PHOTO EMBED

Thu Mar 04 2021 08:22:29 GMT+0000 (Coordinated Universal Time)

Saved by @Bartok #python

from datetime import datetime ,timezone,timedelta


print(datetime.now()) # not aware about time zones , local computer time

print(datetime.now(timezone.utc)) # UTC TIME  +00:00 meaning there is not offset


today =  datetime.now(timezone.utc)
tomorrow = today + timedelta(days=1)

print(tomorrow)

print(today.strftime('%d-%m-%Y %H:%M:%S'))

#user_date = input('Give time in YYYY-mm-dd format')
#user_date = datetime.strptime(user_date,'%Y-%m-%d')

#print(user_date)

print(today.timestamp()) # linux timestamp
content_copyCOPY