How to print a date in a regular format?

后端 未结 22 2819
孤街浪徒
孤街浪徒 2020-11-21 23:00

This is my code:

import datetime
today = datetime.date.today()
print(today)

This prints: 2008-11-22 which is exactly what I wa

22条回答
  •  梦毁少年i
    2020-11-21 23:47

    from datetime import date
    def time-format():
      return str(date.today())
    print (time-format())
    

    this will print 6-23-2018 if that's what you want :)

提交回复
热议问题