作者rexyeah (ccccccc)
看板Python
標題Re: [問題] 時間格式轉換問題
時間Fri Oct 26 11:04:10 2018
推moment (
https://pypi.org/project/moment/)
import moment
d1 = moment.utc('Thu Oct 25 23:36:17 2018')
d2 = moment.utc('Thu Oct 25 23:31:17 2018')
print(d1 - d2)
==
output:
0:05:00
※ 引述《gigigigi (gigigigi)》之銘言:
: 我爬資料網站文章時間格式如下
: Thu Oct 25 23:36:17 2018
: 那我需要比對每篇文章相差幾分鐘
: 想請問一下有方法可以把上面時間格式轉成分鐘後我在相減
: 謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.221.35.72
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1540523053.A.07D.html
推 gigigigi: 讚 10/26 18:41
推 asid52714: 推 10/26 21:18
→ a08054491: 推 11/02 12:24
推 corel: 推 11/02 20:14
推 phoenixcx: 挖...這超簡單 以前code一大堆... 11/20 13:44