stateless-systems / net-ftp-list

29 stars 14 forks source link

Time parsing code has timezone issues #4

Open j2043 opened 13 years ago

j2043 commented 13 years ago

If you retrieve a file off a ftp server on the east coast from a server on the west coast the date on the file may very well be in the future. The code for time parsing look like it assumes times in the future are from the previous year.

This may be a will never fix and I'm ok with that. I just thought you might like to know about this edge case.

tigris commented 12 years ago

Hi there. Thanks for bringing this to light. I believe this might have been fixed in the recent release with the bugfix on leap year parsing by @mschulkind

I'll leave this ticket open until it's confirmed though, if you have time to check it out that'd be fantastic. I've pushed the newest gem live to rubygems.

avit commented 10 years ago

Is there a reliable way of knowing the server's time offset? Specifying a manual offset option in .parse might be needed to solve this reliably.

I'm in PST (-08:00), and selecting a file from our Chicago server (2 hours ahead) shows "2012-12-18 12:00:00" in the raw string, but the parsed ruby time is reported as 2012-12-18 12:00:00 -0800.

I believe the Transmit Mac FTP client uses a technique by uploading a temporary file and checking what mtime it reports vs. the local system time. That could be a feature to consider: monkey patch Net::FTP with utc_offset = ftp.determine_utc_offset?

dim commented 3 years ago

20 attempts to resolve this