he0xff
startDate = "2018-10-01"
endDate = "2018-10-31"

###字符转化为日期
startTime = datetime.datetime.strptime(startDate, \'%Y-%m-%d\').time()
endTime = datetime.datetime.strptime(endDate, \'%Y-%m-%d\').time()

now = datetime.datetime.now()
print(now)

###日期转化为字符串
print("--1---:" + datetime.datetime.strftime(startTime, "%Y-%m-%d"))
print("--2---:" + datetime.datetime.strftime(endTime, "%Y-%m-%d"))

分类:

技术点:

相关文章:

  • 2022-02-11
  • 2022-02-08
  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-27
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
  • 2021-12-27
相关资源
相似解决方案