[Q] ftplib: How to compare date?
Siggy Brentrup
bsb at winnegan.de
Thu Feb 1 16:49:33 EST 2001
"Daehyok Shin" <DSHIN at nc.rr.com> writes:
> I like to compare the creation dates of two files using ftplib.
> But, I cannot find any function to get the date of remote files.
> How can I do it?
Try this:
>>> ftp=ftplib.FTP('localhost')
>>> print ftp.welcome
220 ProFTPD 1.2.0pre10 Server (Debian) [keuner.winnegan.de]
>>> welcome=ftp.login('me','xyzzy')
>>> ftp.sendcmd('MDTM /etc/passwd')
'213 20010131081337'
AFAIK, ftp servers return UTC.
HTH
Siggy
More information about the Python-list
mailing list