Good evening.
I don't find how (if it's even possible) to change date and hour format in file names.
I have files where the date and hour is the file name in the format "yyyymmdd_hhmmss".
For example 20230620_125237.jpg
Is there a way to automatically rename such files like this :
2023-06-20_12-52-37.jpg
Thank you in advance for any hint !
Roland
How to change date format from "20230620" to "2023-06-20" ?
Moderators: Hacker, petermad, Stefan2, white
Re: How to change date and time format in file names ?
Select the files, press ctrl-m for the Multi Rename Tool, press F1 to read and study the help
Method 1 "easy" - Enter this in the NAME field
[N1-4]-[N5-6]-[N7-8]_[N10-11]-[N12-13]-[N14-15]
The preview should show the correct file names, press start.
OR
Method 2 "RegEx" - Tick the RegEx box
Enter this in the Search field
(\d{4})(\d{2})(\d{2})_(\d{2})(\d{2})(\d{2})
This in the replace
$1-$2-$3_$4-$5-$6
Preview OK? -> Start
You can save this solution so you can load it again via F2 Load/Save settings
Method 1 "easy" - Enter this in the NAME field
[N1-4]-[N5-6]-[N7-8]_[N10-11]-[N12-13]-[N14-15]
The preview should show the correct file names, press start.
OR
Method 2 "RegEx" - Tick the RegEx box
Enter this in the Search field
(\d{4})(\d{2})(\d{2})_(\d{2})(\d{2})(\d{2})
This in the replace
$1-$2-$3_$4-$5-$6
Preview OK? -> Start
You can save this solution so you can load it again via F2 Load/Save settings
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Re: How to change date and time format in file names ?
Thanks for the answer !
Meanwhile I found another method that works :
In the rename tool , in the name field (the upper left field, called "Masque p. renom.: nom fichier" in french) I wrote [Y]-[M]-[D]_[h]-[m]-[s] and voilà this did the trick.
Total Commander seems smart enough to understand that my file name contains the date and the hour.
Your method 1 is nice too, method 2 is also interesting but a little too masochistic I think !
Roland
Meanwhile I found another method that works :
In the rename tool , in the name field (the upper left field, called "Masque p. renom.: nom fichier" in french) I wrote [Y]-[M]-[D]_[h]-[m]-[s] and voilà this did the trick.
Total Commander seems smart enough to understand that my file name contains the date and the hour.
Your method 1 is nice too, method 2 is also interesting but a little too masochistic I think !

Roland
Re: How to change date and time format in file names ?
Roland,
Not really. Those placeholders take the date and time from the files' timestamps.
Roman
Not really. Those placeholders take the date and time from the files' timestamps.
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
- ghisler(Author)
- Site Admin
- Posts: 50532
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: How to change date and time format in file names ?
Indeed [Y]-[M]-[D]_[h]-[m]-[s] is NOT equivalent to the solutions posted by [b]hi5[/b]. Normally they are the same for unchanged photos (e.g. from a smart phone), but the file timestamp can change, e.g. when you resize or rotate and then save the image. Then [Y]-[M]-[D]_[h]-[m]-[s] will change the name to that new date and not the original date.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com