我也不知道专业写法,但是我是这样硬取
from datetime import datetime
data = datetime.now()
print(data) # ==>> 2021-11-10 21:30:56.240649
data = str(datetime.now())
data = data.split(' ')
print(data) # ==>> ['2021-11-10', '21:34:46.749916']
data = str(datetime.now()).split(' ')[0]
print(data) # ==>> 2021-11-10