Bug 510976

Summary: FTP has wrong modification time for older files, hour/minute always zero
Product: [Frameworks and Libraries] frameworks-kio Reporter: Erik Krause <erik.krause>
Component: FTPAssignee: KIO Bugs <kio-bugs-null>
Status: REPORTED ---    
Severity: normal CC: kdelibs-bugs-null, me
Priority: NOR    
Version First Reported In: 6.19.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Erik Krause 2025-10-23 20:21:43 UTC
SUMMARY

The kio FTP client does not show the correct modified time for older files (a year old or more). 

STEPS TO REPRODUCE
1. connect to a FTP server using kio (ftp://user@example.com/)
2. open a directory with files last modified longer than a year ago

OBSERVED RESULT

The file "Modified" timestamps show hour and minute as 0 (but with a correct date 00:00)
Copying these files will copy them with this truncated timestamp, which causes mismatches when comparing against files copied from other FTP clients which have accurate timestamps.

EXPECTED RESULT

The file "Modified" timestamps should show an exact hour and minute (such as 11:32).
Files copied from FTP remotes should have the correct modification timestamp.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.19.0
Qt Version: 6.9.2
Kernel Version: 6.16.12-200.fc42.x86_64 (64-bit)

ADDITIONAL INFORMATION

My guess is that kio only uses the RFC 959 LIST command to list directories and extracts the file timestamps from that. LIST is known to lead to inaccurate timestamps on older files due to its human-readable format akin to `ls -l`, see: https://stackoverflow.com/a/29027386

The correct solution would likely involve instead, or preferably, relying on the RFC 3659 commands MLSD (lists a directory), MLST (gets details about a specific file) or MDTM (get the modified time for a file).