stat does not stat files over FTP. You can use the Net::FTP mdtm method to get the files mtime (supposed to be UTC which may not match the date/time you see in a dir listing).
Good catch, runrig. I only tested my code snippet locally and it didn't occur to me that I was using localtime() locally, even though the file stat info would be from another host. I'm too used to relying on my ssh configs and the command line to do things like that:
$ ssh somedomain.com somecommand
Running stat on the remote host would give me the remote localtime. But that's not what the OP is doing.