GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Convert UnixTime to Windows Time in file


#1

Hello,

I would like to know if is it possible to look for a Unixtime string inside a file and use that information to change the own file date/time.

Thanks for reading


#2

You might be able to write a script to do that.


#3

Hi Leo
Do you have have some tips or resources where i can start looking to make such script giving that i have no idea how to make it but willing to spend some time on it?
Thanks


#4

What is the format of the string? How large are the files, and what type are they?


#5

Hello Mrc

The format would be datei1400220748e4 in the second line of the file.
The files can be from about 1kb to 200kb
The file type are .txt

Thanks for reading


#6

I don't recognize that type of timestamp. It isn't an epoch time (as that would be us somewhere around 9/17/2413.


#7

umm i think it is, i can copy that timestamp and convert it to excel time using the next formula:

in cell A2: 1400220748 in cell A3: =(A2/86400)+25569 result: 16-5-2014 06:12:28
or perhaps i am wrong, i don't know much about it.


#8

So the "datei" leading stuff and the "e4" trailing stuff - that's not Unixy.


#9

exactly, tho those strings can be used to locate the timestamp if necessary


#10

Sorry for the delay on this. I've had a backlog of work to get done.

So I've updated my Dynamic Renamer script with some new capabilities, one of which includes the ability to call upon external script code to perform actions such as the one you're requesting. This means script code can be written externally and used, and Dynamic Renamer doesn't have to be updated to do small jobs like this.

I've written and tested the script code that does the job you want. It uses side effects in the Rename tool to change the timestamps, and shows you the time stamps as previews in the Preview window's New Name.

There's no reason the Perl script code itself could not be used inside a button and called directly.

Anyway, I don't know if you're still working on this, or are interested in this approach.