第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

求助python代碼:os.path.getmtime(path),求解釋

求助python代碼:os.path.getmtime(path),求解釋

ITMISS 2021-12-01 21:07:01
os.path.getmtime(path)Return the time of last modification of path. The return value is a number giving the number of seconds since the epoch (see thetime module). Raise os.error if the file does not exist or is inaccessible.這是文檔原文,試了一下,返回了一個極大的數(shù),搞不太懂這個函數(shù)什么意思,有什么用呢?
查看完整描述

2 回答

?
慕田峪4524236

TA貢獻1875條經(jīng)驗 獲得超5個贊

這是一個unix時間戳??梢允褂胐atetime庫來處理時間戳:


import datetime, os= os.path.getmtime('/')tt = datetime.datetime.fromtimestamp(t)ttt = tt.strftime('%Y'# 這是個時間格式化字符串,只能返回年份。


查看完整回答
反對 回復 2021-12-05
?
溫溫醬

TA貢獻1752條經(jīng)驗 獲得超4個贊

返回最近一次修改的時間戳,可以再格式化為你想要的時間格式

查看完整回答
反對 回復 2021-12-05
  • 2 回答
  • 0 關(guān)注
  • 441 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號