09-26-2024 04:38 AM
Maybe this will be helpful.
09-26-2024 04:50 AM
@Bob_Schor wrote:
This reminds me of a colleague who embedded Time Stamp information into the filename. What a mess! Dec 2025 sorts before Jan 2008!
I like the short format of 240926 for todays date, sorts well in a file listing. 🙂
09-26-2024 04:58 AM - edited 09-26-2024 05:00 AM
Hi Paul,
@paul_a_cardinale wrote:
For sortable dates with good readability, I use this format 2025-09nov-01.
So 2025-01aug will be sorted before 2025-01jan?
And 2025-01dec will be sorted in which position of your list?
2025-01aug
2025-01dec
2025-01jan
2025-01mar
(I'm a HUGE fan of ISO8601…)
09-26-2024 08:50 AM
@GerdW wrote:
Hi Paul,
@paul_a_cardinale wrote:
For sortable dates with good readability, I use this format 2025-09nov-01.So 2025-01aug will be sorted before 2025-01jan?
And 2025-01dec will be sorted in which position of your list?
2025-01aug 2025-01dec 2025-01jan 2025-01mar
(I'm a HUGE fan of ISO8601…)
My example was incorrect. The format I use is yyyy-mmnnn-dd. Which would be something like 2025-09sep-01.
I also am a big fan of ISO8601, But sometimes, for extra readability, I append the month abbreviation to the month number.
10-02-2024 04:47 PM
Thanks for the link to the sorting library. This did the job.
Girish
10-03-2024 04:11 PM
Hi, Girish. You did a great service by trying various methods to get the file list in the order you want. Now, please go back to this thread and "Mark as Solution" the one that describes "what works for you". [I'm not sure which of several similar "variations on a theme" you decided to adopt, but if we've helped you by suggesting "thinks to try", help us and other future readers of this thread by indicating "which one worked best" for you.]
Bob Schor
10-05-2024 10:41 AM - edited 10-05-2024 10:49 AM
For fun, I implemented a quick idea that will consider all numerical "fields" (20 consecutive numeric digits or less) are considered are treated as numeric for the sorting logic.
Probably needs a few tweaks, but seems more universal than code found elsewhere here.
Yes, the "scan-format" operation could be avoided but this is more readable)
10-05-2024 01:03 PM
I like the concept.
Here's my hack at it.