LoginSignup
3
3

More than 5 years have passed since last update.

python > ファイル最終更新日を取得する > mddt = time.ctime(os.path.getmtime(filepath)) > Mon Mar 7 07:18:45 2016

Last updated at Posted at 2016-03-08
動作確認
Raspberry Pi2 + raspbian

send.txt というファイルの最終更新日を使って、message stationのメッセージ投函日にしようかと検討中。

ファイルパスから最終更新日を取得するのは以下でできた。

160308_fileLastModificationDate.py
import os.path
import time

filepath = "/home/pi/BYOP/send.txt"
mddt = time.ctime(os.path.getmtime(filepath))
print mddt
結果
Mon Mar  7 07:18:45 2016

ここから[年月日]の数値を読み取る方法を調べる。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3