Page 1 of 1
Video info to change file creation time
Posted: 01 Jan 2023 02:09
by tomuser
Hi and Happy New Year!
I stumbled upon issue where file timestamps are not correct, meaning if there are copy actions made outside XYplorer then it does no preserve file timestamps (modified and created) and changes them to time when copy action is made. This is one of top features (besides the many other things) I like in XYplorer that it does preserve them. Makes it easier to compare and backup files needed.
With pictures taken it's easy to use EXIF to change timestamps to correct them using XYplorer native commands. But not so easy with videos. When checking video file properties I see that there is actually original created date written into details. So my request would be that I could use this field same as EXIF with pictures to set/change file creation and modified date/time.

Re: Video info to change file creation time
Posted: 01 Jan 2023 17:31
by admin
This will return that date:
Code: Select all
text property("System.Media.DateEncoded");
You should be able to do the rest with scripting.
Re: Video info to change file creation time
Posted: 01 Jan 2023 18:58
by tomuser
Thanks for quick reply. Unfortunately words "scripting" and "me" do not fit into same sentence

. Max I can do is:
or
So any help using property given above placed in correct way together with additional commands and attributes would be appreciated.
Re: Video info to change file creation time
Posted: 01 Jan 2023 19:12
by admin
It's not as hard as you think. Select your MP4 file and run this through the address bar:
Code: Select all
timestamp c, property("System.Media.DateEncoded");
If the file has a "Media Created" date then the creation time will be set.
Re: Video info to change file creation time
Posted: 01 Jan 2023 19:58
by tomuser
Brilliant! I've tried it together with "text" in front and also together with <> marks around it to no avail. Didn't realize to remove "text" part.
But seems that this date is stored as UTC or something as if I set it to creation date then time set is 08:59 instead of 10:59 and it doesn't reflect time zone.
So I added second line to run for time shift
Code: Select all
timestamp c, property("System.Media.DateEncoded");
timestamp c, "*", , , "2 h";
Re: Video info to change file creation time
Posted: 01 Jan 2023 20:05
by admin
Yes, it's in UTC.
I'd rather shift it first, then stamp it:
Code: Select all
$mcdate = formatdate(property("System.Media.DateEncoded"),,h,2); timestamp c, $mcdate;
Re: Video info to change file creation time
Posted: 01 Jan 2023 20:32
by jupe
FYI If you use the numerical property ID instead, it is already time shifted. timestamp c, <prop #208>;
Re: Video info to change file creation time
Posted: 01 Jan 2023 20:35
by admin
Unfortunately the number is not the same across systems. Here it is #197.
Re: Video info to change file creation time
Posted: 01 Jan 2023 20:36
by tomuser
Thanks
Now I need to figure out how to use it for renaming files as well. This annoys me if device makes filenames as MOV_001 or DSC_001 or similar and not using actual time stamp for it and may cause accidental loss by overwriting files with these kind of names.
(And then find a way to set it up as command line action for Stream Deck and/or Touch Portal app to make it easy only-one-button-press-action to save the world

)
Re: Video info to change file creation time
Posted: 01 Jan 2023 23:54
by tomuser
admin wrote: ↑01 Jan 2023 20:05
I'd rather shift it first, then stamp it:
Code: Select all
$mcdate = formatdate(property("System.Media.DateEncoded"),,h,2); timestamp c, $mcdate;
One more thing. Commands above set same timestamp for all selected files. How could I run it that each file gets their own timestamp? I tried to mess with quotation marks (single and double) but couldn't put in proper place probably.
Re: Video info to change file creation time
Posted: 02 Jan 2023 00:08
by highend
Because you need to run it in a loop for all selected files...
Re: Video info to change file creation time
Posted: 02 Jan 2023 15:55
by admin
Next beta:
Code: Select all
timestamp c, '<datemedia>'; //set created date of all selected items to their "media created" date
Re: Video info to change file creation time
Posted: 02 Jan 2023 18:37
by tomuser
admin wrote: ↑02 Jan 2023 15:55
Next beta:
Code: Select all
timestamp c, '<datemedia>'; //set created date of all selected items to their "media created" date
wow, just wow

thanks. i used to be beta-kamikaze in past but not anymore for long time. but couldn't resist on this one
