import datetime
now = datetime.datetime.now()
print(now.year, now.month, now.day, now.hour, now.minute, now.second)
>>> import datetime
>>> today = datetime.datetime.now()
>>> print today
2009-03-06 15:37:02.484000
>>> today.strftime('%j')
'065'
from datetime import datetime
day_of_year = datetime.now().timetuple().tm_yday
import datetime
now = datetime.datetime.now()
print(str(now.day).zfill(2)+'-'+str(now.month).zfill(2)+'-'+str(now.year)+' '+str(now.hour).zfill(2)+':'+str(now.minute).zfill(2)+':'+str(now.second).zfill(2))
# Output
# 24-05-2021 17:09:45
df['day_of_year'] = df['date_given'].dt.dayofyear
print(df)