datetime.now()
会得到当前时间,
datetime.datetime(2023, 2, 13, 17, 24, 29, 309381
currentDateAndTime = datetime.now()
print(f'Time: {currentDateAndTime.year}/{currentDateAndTime.month}/{currentDateAndTime.day}')
Time: 2023/2/13
参考:
[1] https://www.freecodecamp.org/chinese/news/how-to-get-the-current-time-in-python-with-datetime
[2] https://www.freecodecamp.org/chinese/news/python-datetime-now-how-to-get-todays-date-and-time/