How to get today date in Python

1 Answer

0 votes
import datetime
 
today = datetime.date.today()     
print(today)

print(today.ctime())



'''
run:

2019-06-05
Wed Jun  5 00:00:00 2019

'''

 



answered Jun 5, 2019 by avibootz

Related questions

1 answer 207 views
1 answer 219 views
1 answer 191 views
1 answer 245 views
1 answer 161 views
1 answer 166 views
1 answer 209 views
...