linux/shell: change a file's modify timestamp relatively?

Posted by index on Super User See other posts from Super User or by index
Published on 2010-03-22T18:48:57Z Indexed on 2012/09/03 9:41 UTC
Read the original article Hit count: 252

Filed under:
|
|
|
|

My Canon camera produces files like IMG_1234.JPG and MVI_1234.AVI. It also timestamps those files. Unfortunately during a trip to another timezone several cameras were used, one of which did not have the correct time zone set -> meta data mess.. Now I would like to correct this (not EXIF, the file's "modify" timestamp on disk).

Proposed algorithm:

1 read file's modify date
2 add delta, i.e. hhmmss (preferred: change timezone)
3 write new timestamp

Unless someone knows a tool or a combination of tools that do the trick directly, maybe one could simplify the calculation using epoch time (seconds since ..) and whip up a shell script.

Any help appreciated!

© Super User or respective owner

Related posts about linux

Related posts about date