from datetime import datetime

# now=datetime.now().strftime('%Y-%m-%d %H:%M:%S')
# print(now)
# dc = datetime.strptime(now,"%Y-%m-%d %H:%M:%S")


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

t1=datetime.fromisoformat('2019-11-11T00:52:43+00:00')
print(t1)

t2=datetime.strptime("2008-09-03T20:56:35.450686Z", "%Y-%m-%dT%H:%M:%S.%fZ")
print(t2)

t3=datetime.strptime("2021-08-06T00:30:00.000+0000", "%Y-%m-%dT%H:%M:%S.%f%z")
print(t3)


            # 记录离最近使用时间最远的
            last=datetime.strptime(self.ips[i]['last'],"%Y-%m-%d %H:%M:%S")
            if (now-last).seconds > max_seconds:
                max_seconds=(now-last).seconds
                maxid=i

 

相关文章:

  • 2022-12-23
  • 2021-07-02
  • 2021-12-29
  • 2021-11-17
  • 2022-12-23
  • 2021-08-26
  • 2021-08-21
  • 2021-07-01
猜你喜欢
  • 2022-01-25
  • 2021-07-18
  • 2021-09-21
  • 2022-12-23
相关资源
相似解决方案