当前位置:首页 - Python

python计算时间差

作者:高景洋 日期:2020-12-03 16:12:14 浏览次数:1711
a = '2020-10-13 16:58:40'
last_time = datetime.datetime.strptime(a,'%Y-%m-%d %H:%M:%S')
seconds_diff = (datetime.datetime.now()-last_time).total_seconds()
minutes_diff = seconds_diff / 60
本文永久性链接:
<a href="http://r4.com.cn/art165.aspx">python计算时间差</a>
当前header:Host: r4.com.cn X-Host1: r4.com.cn X-Host2: r4.com.cn X-Host3: 127.0.0.1:8080 X-Forwarded-For: 3.235.182.206 X-Real-Ip: 3.235.182.206 X-Domain: r4.com.cn X-Request: GET /art165.aspx HTTP/1.1 X-Request-Uri: /art165.aspx Connection: close User-Agent: CCBot/2.0 (https://commoncrawl.org/faq/) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 If-Modified-Since: Mon, 04 Dec 2023 23:52:20 GMT Accept-Encoding: br,gzip