get the creating date of files ftp python

Solutions on MaxInterview for get the creating date of files ftp python by the best coders in the world

showing results for - "get the creating date of files ftp python"
Yohan
13 Jun 2018
1connection = ftplib.FTP(**ftpCredentials)
2modifiedTime = connection.sendcmd('MDTM ' + fileName)
3# successful response: '213 20120222090254'
4
Philippe
12 Oct 2019
1from datetime import datetime
2
3print datetime.strptime(modifiedTime[4:], "%Y%m%d%H%M%S").strftime("%d %B %Y %H:%M:%S")
4# prints something like 01 January 1970 09:30:01
5