@staticmethod
    def cha_count(start: str, end: str):
        """
        计算两个日期相差多少天
        @param start: '20210820'
        @param end: '20210827'
        @return: 7
        """
        old = datetime.datetime(int(start[0:4]), int(start[4:6]), int(start[6:8]))
        now = datetime.datetime(int(end[0:4]), int(end[4:6]), int(end[6:8]))
        count = (now - old).days
        print(count)
        return count

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2021-12-03
  • 2021-03-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-18
  • 2022-01-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案