import 库名
或者
from 库名 import 库里的一个功能
import time print(time.strftime("%Y-%m-%d %H:%M:%S"))
2023-04-01 20:14:44
from datetime import datetime print(datetime.now().strftime("%Y-%m-%d %H:%M:%S")) print(datetime.today()) print(datetime.today().year) print(datetime.today().month) print(datetime.today().day)
2023-04-01 20:21:23 2023-04-01 20:21:23.162748 2023 4 1