Python获取今天的日期

2024-01-02
#Python

代码:

import datetime

def Get_Date_Of_Today():
    Today = datetime.date.today()
    format_day = Today.strftime("%Y-%m-%d")
    return format_day

调用:

print(Get_Date_Of_Today())

输出:

2024-01-02