Answers for "get the creating date of files ftp python"

0

get the creating date of files ftp python

connection = ftplib.FTP(**ftpCredentials)
modifiedTime = connection.sendcmd('MDTM ' + fileName)
# successful response: '213 20120222090254'
Posted by: Guest on January-19-2021
0

get the creating date of files ftp python

from datetime import datetime

print datetime.strptime(modifiedTime[4:], "%Y%m%d%H%M%S").strftime("%d %B %Y %H:%M:%S")
# prints something like 01 January 1970 09:30:01
Posted by: Guest on January-19-2021

Python Answers by Framework

Browse Popular Code Answers by Language