need a plugin to multi edit timestamp of the files.

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
haibinpro
Junior Member
Junior Member
Posts: 66
Joined: 2005-10-21, 04:55 UTC
Location: china

need a plugin to multi edit timestamp of the files.

Post by *haibinpro »

I have some img files and mpg files.
somewhat like this:
IMG_20151205_234758.jpg
IMG_20151205_234808.jpg
VID_20150912_101652.mpg
VID_20151129_135030.mpg

as when i use ftp or other solution to download/chansfer files from my phone to pc,the edit timestamp of the files are auto change .

for some reason,I have to remain the timestamp.(currently I can use some app install in phone and use it to zip all the files and download the zipfile and than extract to meet this),So i need a plugin to change edit timestamp by file's name,
such as
IMG_20151205_234758.jpg will change edit time to 2015.12.05 23:47:58.
I try to find plugin at http://totalcmd.net/,
but find nothing

Fix Time 1.11
ReDate Addon 1.1.2

are not meet my requierment


If any one known a plugin to do this ,please let me known,thanks.

I try find some thirdparty software or cmd bat files to match my requiement.not any supprise.
Last edited by haibinpro on 2016-05-12, 14:25 UTC, edited 1 time in total.
______________________
#147708 Personal licence
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

haibinpro,
Try Files - Change Attributes...
[x] Change plugin attributes
tc - writedate
Enter this as Value

Code: Select all

[=tc.name:11-12].[=tc.name:9-10].[=tc.name:5-8] [=tc.name:14-15]:[=tc.name:16-17]:[=tc.name:18-19]
Of course you must format the string using your regional setings, I am using DD.MM.YYYY HH:MM:SS.

HTH
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.
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

PowerShell: Set timestamp from file name

Post by *Stefan2 »

You may want to try PoSh for that:

Code: Select all

CMD: PowerShell -NoProfile -ExecutionPolicy Bypass -NoExit

Para: Dir | ForEach{$TS=$_.BaseName -replace '....(....)(..)(..)_(..)(..)(..)','$1-$2-$3 $4:$5:$6';$_.LastWriteTime=$TS;$_.CreationTime=$TS}

Explanations:

The CMD could just be 'powershell' alone too, or with parameters as show here.

The Para(meter) is one long line:
Dir | ForEach{$TS=$_.BaseName -replace '....(....)(..)(..)_(..)(..)(..)','$1-$2-$3 $4:$5:$6';$_.LastWriteTime=$TS;$_.CreationTime=$TS}


The RegEx on the '-replace' command will match on file names like:
IMG_20151205_234808.jpg
VID_20150912_101652.mpg

The '-replace With'-part will format the extracted date string to an valid DateTime string used in my country:
-> YYYY-MM-DD HH:MM:SS -> 2015-12-05 23:48:08

That string is stored in a variable $TS for TimeStamp, which the '$_.LastWriteTime=xxx' part utilize as wanted date to set.

That '$_' -part represents just the current processed file object.


Tested with PowerShell v2.0



HTH? :D
haibinpro
Junior Member
Junior Member
Posts: 66
Joined: 2005-10-21, 04:55 UTC
Location: china

Post by *haibinpro »

Hacker wrote:haibinpro,
Try Files - Change Attributes...
[x] Change plugin attributes
tc - writedate
Enter this as Value

Code: Select all

[=tc.name:11-12].[=tc.name:9-10].[=tc.name:5-8] [=tc.name:14-15]:[=tc.name:16-17]:[=tc.name:18-19]
Of course you must format the string using your regional setings, I am using DD.MM.YYYY HH:MM:SS.

HTH
Roman
Thanks Hacker, You are so kind.

I record it and post to forum,hope it may help someone
the value data I use is
[=tc.name:5-8].[=tc.name:9-10].[=tc.name:11-12] [=tc.name:14-15]:[=tc.name:16-17]:[=tc.name:18-19]

Image: http://upload.ouliu.net/i/2016051912360587b2a.gif
______________________
#147708 Personal licence
Post Reply