Bug in TC's Date Sort
Moderators: Hacker, petermad, Stefan2, white
Bug in TC's Date Sort
I have found a bug in TC (seen in both v5.51 & v6). When you click on the Date column to sort files by date, the sort does not work correctly. Instead of the most current one being first in the list, it is actually listed at number 8 or 9. Windows Explorer & my graphics viewer sort the files correctly, so the problem only exists in TC. I run Windows XP.
Sounds like it could be one of those tricky bugs to track down the cause for - it definitely doesn't work properly on my SP1. For some reason, TC thinks that a file modified at 1:00:44 is later than a file modified at 1:00:45 (created 2:40:54 & 2:40:55 the day before respectively), & thus puts the :44 file ahead of the :45 in the date sort. I use the date sort quite frequently, so this is quite annoying for me 

- Boofo
- Power Member
- Posts: 1431
- Joined: 2003-02-11, 00:29 UTC
- Location: Des Moines, IA (USA)
- Contact:
I only checked the dates before. I just checked the times and they work like they are supposed to, too. There must be something else going on somewhere to cause that. Check you time setup in Windows and see if everything is all right there. Other than that, I'm lost as to the cause. Sorry I couldn't be of more help.romulous wrote:Sounds like it could be one of those tricky bugs to track down the cause for - it definitely doesn't work properly on my SP1. For some reason, TC thinks that a file modified at 1:00:44 is later than a file modified at 1:00:45 (created 2:40:54 & 2:40:55 the day before respectively), & thus puts the :44 file ahead of the :45 in the date sort. I use the date sort quite frequently, so this is quite annoying for me

Hm, I just checked the time setup, & the time is correct, date is correct, time zone is ok. The only thing I can think of is it may be related to the "Ignore 1 Hour Time Delay" setting in TC (Options-Operation-NTFS Daylight Saving Correction), though I have no idea how - I've read the description of it in TC help & it seems to be only for file synchronization. Does your TC show the 24 hour time, or the 12 hour AM/PM format? Mine shows the 24 hour format in the TC window, but the 12 hour format when you right click on the file & go into properties. As I said before though, the native Windows Explorer date sorts the files fine, it is just TC that has the problem. Very puzzling.
- ghisler(Author)
- Site Admin
- Posts: 50475
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
TC cannot sort by the second, only with 2 second details. Why? Internally it uses FAT32 date/time representation, which is only 2 seconds exact.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50475
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Unfortunately not - this is needed for compatibility reasons.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Hi Christian,
Can I ask what exactly is TC trying to be compatible with? The date sort works ok on some files, on others it has the bug as I described. As I mentioned, this is a big problem for me because I use the date sort very frequently, in conjuction with an external file viewing program, & this bug causes a mismatch between what TC says should be the next file shown & what file is actually shown by the external program (which sorts them correctly), making the use of TC for this purpose useless. So it would be interesting to know why this bug needs to be kept in TC, especially as the native Windows Explorer works fine in this regard.
Can I ask what exactly is TC trying to be compatible with? The date sort works ok on some files, on others it has the bug as I described. As I mentioned, this is a big problem for me because I use the date sort very frequently, in conjuction with an external file viewing program, & this bug causes a mismatch between what TC says should be the next file shown & what file is actually shown by the external program (which sorts them correctly), making the use of TC for this purpose useless. So it would be interesting to know why this bug needs to be kept in TC, especially as the native Windows Explorer works fine in this regard.
[face=courier]On 19-11-2003 07:45:54 +0000 romulous wrote:
r> For some reason, TC thinks that a file modified at 1:00:44
r> is later than a file modified at 1:00:45 (created 2:40:54 &
r> 2:40:55 the day before respectively), & thus puts the :44
r> file ahead of the :45 in the date sort.
What are the complete timestamps of those files (including year in 4-digit format)?[/face]
r> For some reason, TC thinks that a file modified at 1:00:44
r> is later than a file modified at 1:00:45 (created 2:40:54 &
r> 2:40:55 the day before respectively), & thus puts the :44
r> file ahead of the :45 in the date sort.
What are the complete timestamps of those files (including year in 4-digit format)?[/face]
[face=courier]The Protoss do NOT run from their enemies.
It is here, that we shall make our stand.[/face]
It is here, that we shall make our stand.[/face]
An example is:
Created: 17 December 2003 5:52:58PM
Modified: 17 December 2003 5:41:44PM
(from File-Properties), but listed in just the TC window as:
17/12/03 17:41
The above file is listed as being LATER than this one:
Created: 17 December 2003 5:52:58PM
Modified: 17 December 2003 5:41:45PM
(from File-Properties), but listed in just the TC window as:
17/12/03 17:41
This is plainly incorrect. Last time I checked, 5:41:45 was created later than 5:41:44, not the other way around as TC suggests.
Created: 17 December 2003 5:52:58PM
Modified: 17 December 2003 5:41:44PM
(from File-Properties), but listed in just the TC window as:
17/12/03 17:41
The above file is listed as being LATER than this one:
Created: 17 December 2003 5:52:58PM
Modified: 17 December 2003 5:41:45PM
(from File-Properties), but listed in just the TC window as:
17/12/03 17:41
This is plainly incorrect. Last time I checked, 5:41:45 was created later than 5:41:44, not the other way around as TC suggests.
The odd thing is that I don't recall previous versions of TC having this bug. I know it occurred in the v5.5x series, but I'm nearly 100% sure that some of the prior versions to this worked fine. Sadly, TC is now all over the place with its date sorts (half the time the files are sorted correctly, half the time they aren't), making this feature unusable. Time for me to go look at other file managers seeing as Christian has stated that this bug won't be fixed. It would be nice to know exactly what TC is trying to be compatible with - especially as I've stated, the native Windows Explorer works fine. Anyone shed some light on this?
TC is trying to be compatible with time/date related functions provided in Windows versions that did not suport NTFS. For instance there is one function in all windows versions that can be used to set the date using two-second precision. There is, however, another, newer function in W2K upwards that supports a higher precision. So Christian would have to check what system TC is being currently run on and use the appropriate function. That wouldn't be that difficult, however, these functions expect dates and times in another format, so TC would have to convert the timestamps each time or store them in various formats, etc.what exactly is TC trying to be compatible with?
To sum up, there'd be too many problems (not mentioning the DST adjustment used on NTFS, etc.),
Concerning Explorer, Explorer doesn't equal Explorer. I doubt XP's Explorer would sort these dates correctly on W95, nay it would run on that platform, and vice versa.
HTH
Roman