Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear All, I am trying to retrieve the file using ftp, but I would like to get the file that is created today's date. So I need try to compare the file date with today's date. I am using $ftp->mdtm command to get the date, but date is Unix Timestamp Format. I do not know how to compare with today. any help more than welcome. Thanks, nevzat

Replies are listed 'Best First'.
Re: $ftp->mdtm question
by zby (Vicar) on Mar 19, 2003 at 16:30 UTC
    See the documentation for the localtime built in function ( perldoc -f localtime).
Re: $ftp->mdtm question
by fokat (Deacon) on Mar 19, 2003 at 21:58 UTC

    Beware the timezone differences. It seems that there is not a standard way to learn the timezone in which the FTP server is running. IIRC, MDTM should return the timestamp in UTC, but I've found this to be unreliable.

    In a utility I wrote (here and here), I simply add an offset to the time to make an accurate comparison.

    Best regards

    -lem, but some call me fokat