-
Notifications
You must be signed in to change notification settings - Fork 2
/
oldest_datetime_config
36 lines (34 loc) · 1.31 KB
/
oldest_datetime_config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Save as .ExifTool_config in you home directory so that exiftool can read this
%Image::ExifTool::UserDefined = (
'Image::ExifTool::Composite' => {
# Select oldest date from a number of date tags
OldestDateTime => {
Desire => {
0 => 'FileModifyDate',
1 => 'MDItemFSContentChangeDate',
2 => 'FileCreateDate',
3 => 'MDItemFSCreationDate',
4 => 'ModifyDate',
5 => 'CreateDate',
6 => 'DateTimeCreated',
7 => 'DateTimeOriginal',
8 => 'GPSDateTime',
9 => 'CreationDate'
},
ValueConv => q{
my $oldest = undef;
for my $date (@val) {
next if not defined $date or $date lt '1970:01:02';
$date =~ s/([+-]\d{2}:\d{2}$)|([A-Z]{3}$)|([Z]$)//; # Strip TimeZone 2018:12:24 10:57:48'-05:00' or 2018:10:18 07:19:58'Z or EDT'
if ($date && (!$oldest || $date lt $oldest)) {
$oldest = $date;
}
}
$oldest =~ s/([+-]\d{2}:\d{2}$)|([A-Z]{3}$)|([Z]$)//;
return $oldest;
},
PrintConv => '$self->ConvertDateTime($val)',
},
},
);
1;