[Q] ftplib: How to compare date?

Daehyok Shin DSHIN at nc.rr.com
Fri Feb 2 07:00:43 CET 2001


What I want is not the local time of systems,
but the creation time of files.


"Siggy Brentrup" <bsb at winnegan.de> wrote in message
news:mailman.981067505.10896.python-list at python.org...
> "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