EPOCH (Unix time)

Post any Bulk Rename Utility support requirements here. Open to all registered users.

EPOCH (Unix time)

Postby DJALLEN » Sat Oct 12, 2013 5:28 am

I have a list of about 100 files that were downloaded from a photo sharing site that was used for my wedding. They were shot on iPhones and Androids and the EXIF data was stripped.

The files names have the date & time, but it's in EPOCH format. Is there a way for me to take the file name and convert it with BR into the EXIF?
DJALLEN
 
Posts: 2
Joined: Sat Oct 12, 2013 5:24 am

Re: EPOCH (Unix time)

Postby Stefan » Sat Oct 12, 2013 7:01 pm

Sort off.

You could

1.) get the current filename, for example in BRU from context menu, or with DOS> "dir /B > filenameslist.txt"


2.) use a tool to convert this to date, but as far as I understood you have to adjust the result to match your timezone/locate,
if the epoch timestamp is taken on a different timezone (or something like this, I am not an expert)

Tools to convert could be e.g.:

Excel > http://tsmeltzer.wordpress.com/2011/04/07/convert-epoch-time-to-datetime-in-excel/

JavaScript >
tried with EmEditor:
Code: Select all
alert (  epochToJsDate(1381600676)  );
function epochToJsDate(epochTimestamp){
        d = new Date(epochTimestamp*1000);
        day = ('0'+d.getDate()).slice(-2);
        mon = ('0'+(d.getMonth()+1)).slice(-2);
        yea = d.getFullYear();
        hou = ('0'+d.getHours()).slice(-2);
        min = ('0'+d.getMinutes()).slice(-2);
        return yea+'_'+mon+'_'+day+'_'+hou+min;
   }

Code: Select all
---------------------------
EmEditor
---------------------------
2013_10_12_1957
---------------------------
OK   
---------------------------



3.) use Bulk Rename Utility "Renaming From A Text File" feature

1381600676.jpeg|Wedding_2013_10_12_1957.jpg

The Bulk Rename Utility Help says:

Renaming From A Text File

Starting with version 2.2.6.0 it is possible to rename files according to a text-file.
This text file should contain a list of "old name" and "new name" pairs, separated by a pipe symbol ( | ).

To use this facility, create a text file in for the correct format, for example:

Track001.mp3|Headlong.mp3
Track002.mp3|Rushes.mp3
TRACK003.mp3|AnywhereIs.mp3

As you see, there is one entry per line.


Next, click the Import option on the File menu and load your file.
If the file is valid then you will see the "new name" column reflecting the contents of the text file.

When comparing the current filename with the text file the application ignores the case of the filename,
e.g. it will happily match Track001.mp3 and TRACK001.mp3. This makes it easy to rename the files.



More for "Renaming From A Text File" and Excel e.g. at http://www.bulkrenameutility.co.uk/forum/viewtopic.php?p=4120#p4120



4.)
Next time, please provide "current name" > "wanted name" examples!!!

See online http://www.epochconverter.com/ for doing some tests.

Tell us how it goes...


5.)
Use ExifTool by Phil Harvey to write the date, gotten from the date in the file name, to the files EXIF data.
http://www.sno.phy.queensu.ca/~phil/exiftool/




- - -

EDIT

I think, I would do it like this:

1.) Open your file in Bulk Rename Utility
2.) select All and use context menu > Clipboard Copy > "FileName + Ext"


3.) open Excel and paste this list to column A
1381600676.jpeg


4.) In column B paste the converted timestamps
2013_10_12_1957.jpeg

You may want to use something like described there >
http://tsmeltzer.wordpress.com/2011/04/07/convert-epoch-time-to-datetime-in-excel/


5.) in column C type
= A1 & "|" & B1

and copy this to all columns down.



6.) select the C column and paste this as text to an text file.
1381600676.jpeg|2013_10_12_1957.jpeg


7.) In BRU use the "Renaming From A Text File" feature


.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: EPOCH (Unix time)

Postby DJALLEN » Sat Oct 12, 2013 10:53 pm

Wow, that's an excellent right-up. I really appreciate that, I'm going to give it a go.

Sorry I forgot the timezone, it's Eastern Standard.

Thanks for the help! ;)
-dan
DJALLEN
 
Posts: 2
Joined: Sat Oct 12, 2013 5:24 am

Re: EPOCH (Unix time)

Postby truth » Sun Oct 13, 2013 2:05 pm

BRU never modifies (or creates) EXIF data within a file.

I'm not aware of any graphical apps capable of that FileName(withPosixTime) -> ExifDate/Time creation,
I'd prob write a batch to automate this, using both sed & jhead (still haven't tried ExifTool).

If you happen to use those tools & want post your filename-structure, I could post a .bat for this.
Otherwise, stay with the previous posts.
truth
 
Posts: 221
Joined: Tue Jun 25, 2013 3:39 am
Location: Earth, OrionArm, MilkyWay


Return to BRU Support