Bug 510976 - FTP has wrong modification time for older files, hour/minute always zero
Summary: FTP has wrong modification time for older files, hour/minute always zero
Status: REPORTED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: FTP (other bugs)
Version First Reported In: 6.19.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-23 20:21 UTC by Erik Krause
Modified: 2025-10-23 20:22 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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).