example filename is VID_20211212_224227.mp4
Creation Date and Modified Date shall be 12.12.2021 and time 22:42:27
EXIF date is not available
I'm looking for an automatic script for many files
Any ideas?
Thanks for your help.
change date from part of filename
-
highend
- Posts: 14925
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: change date from part of filename
Code: Select all
$items = <get SelectedItemsPathNames>;
end (!$items), "No item(s) selected, aborted!";
foreach($item, $items, <crlf>, "e") {
$base = gpc($item, "base");
$date = gettoken($base, 2, "_");
$date = substr($date, 0, 4) . "-" . substr($date, 4, 2) . "-" . substr($date, 6, 2);
$time = gettoken($base, 3, "_");
$time = substr($time, 0, 2) . ":" . substr($time, 2, 2) . ":" . substr($time, 4, 2);
if (strlen($date) != 10 || strlen($time) != 8) { continue; }
timestamp "cm", $date . " " . $time, $item;
}
One of my scripts helped you out? Please donate via Paypal
-
co999
- Posts: 5
- Joined: 13 Sep 2021 14:46
Re: change date from part of filename
That was helpful. Thank you very much! 
XYplorer Beta Club