get the creating date of files ftp python 1

get the creating date of files ftp python

connection = ftplib.FTP(**ftpCredentials)
modifiedTime = connection.sendcmd('MDTM ' + fileName)
# successful response: '213 20120222090254'

Here is what the above code is Doing:
1. The ftplib.FTP() function takes a dictionary of credentials.
2. The sendcmd() method sends a command to the FTP server and returns the response.
3. The MDTM command returns the last modified time of a file.

Similar Posts