Image-ExifTool - Re: How to create a composite date that is shifted by 2 months earlier

Posted on Thu Dec 20 14:29:32 2007 by exiftool in response to 6732 (See the whole thread of 2)
Re: How to create a composite date that is shifted by 2 months earlier
Shifting date/time values is difficult because Perl (or any other language) doesn't provide built-in support for doing this. But you can take advantage of an ExifTool function to do this. The following user-defined tag will shift the date/time back by 2 months:

%Image::ExifTool::UserDefined = ( 'Image::ExifTool::Composite' => { ShiftedDateTime => { Require => 'DateTimeOriginal', ValueConv => q{ require 'Image/ExifTool/Shift.pl'; Image::ExifTool::ShiftTime($val, '0:2:0 0:0:0', -1); return $val; }, PrintConv => '$self->ConvertDateTime($val)', }, }, );
Write a response