How to set a variable to be “Today's” date in Python/Pandas

后端 未结 8 2195
醉话见心
醉话见心 2020-12-23 19:35

I am trying to set a variable to equal today\'s date.

I looked this up and found a related article:

Set today date as default value in the model

Howe

8条回答
  •  礼貌的吻别
    2020-12-23 20:06

    Easy solution in Python3+:

    import time
    
    
    todaysdate = time.strftime("%d/%m/%Y")
    
    #with '.' isntead of '/'
    todaysdate = time.strftime("%d.%m.%Y")
    

提交回复
热议问题