Problem Setting FileModifyDate

Started by Archive, May 12, 2010, 08:54:22 AM

Previous topic - Next topic

Archive

[Originally posted by justin on 2008-07-18 11:15:00-07]

Hi Phil, I got round to testing with the "auto adjust for daylight savings" turned off with the following results:

Code:
C:\nefs>exiftool -alldates -filemodifydate *
======== 2007-03-25_D50_DSC_4513.NEF
Date/Time Original              : 2007:03:25 18:35:16
Create Date                     : 2007:03:25 18:35:16
Modify Date                     : 2007:03:25 18:35:16
File Modification Date/Time     : 2008:07:14 16:02:49
======== 2007-03-25_D50_DSC_4514.NEF
Date/Time Original              : 2007:03:25 18:35:37
Create Date                     : 2007:03:25 18:35:37
Modify Date                     : 2007:03:25 18:35:37
File Modification Date/Time     : 2008:07:14 16:02:49
======== 2007-03-25_D50_DSC_4515.NEF
Date/Time Original              : 2007:03:25 18:35:59
Create Date                     : 2007:03:25 18:35:59
Modify Date                     : 2007:03:25 18:35:59
File Modification Date/Time     : 2008:07:14 16:02:49
======== DSC_1056.NEF
Date/Time Original              : 2008:06:18 15:10:17
Create Date                     : 2008:06:18 15:10:17
Modify Date                     : 2008:06:18 15:10:17
File Modification Date/Time     : 2008:06:18 16:10:20
    4 image files read

C:\nefs>exiftool "-filemodifydate<createdate" *
    4 image files updated

C:\nefs>exiftool -alldates -filemodifydate *
======== 2007-03-25_D50_DSC_4513.NEF
Date/Time Original              : 2007:03:25 18:35:16
Create Date                     : 2007:03:25 18:35:16
Modify Date                     : 2007:03:25 18:35:16
File Modification Date/Time     : 2007:03:25 19:35:16
======== 2007-03-25_D50_DSC_4514.NEF
Date/Time Original              : 2007:03:25 18:35:37
Create Date                     : 2007:03:25 18:35:37
Modify Date                     : 2007:03:25 18:35:37
File Modification Date/Time     : 2007:03:25 19:35:37
======== 2007-03-25_D50_DSC_4515.NEF
Date/Time Original              : 2007:03:25 18:35:59
Create Date                     : 2007:03:25 18:35:59
Modify Date                     : 2007:03:25 18:35:59
File Modification Date/Time     : 2007:03:25 19:35:59
======== DSC_1056.NEF
Date/Time Original              : 2008:06:18 15:10:17
Create Date                     : 2008:06:18 15:10:17
Modify Date                     : 2008:06:18 15:10:17
File Modification Date/Time     : 2008:06:18 15:10:17
    4 image files read

C:\nefs>exiftool -filemodifydate-=1 *
    1 image files updated
    3 image files unchanged

C:\nefs>exiftool -alldates -filemodifydate *
======== 2007-03-25_D50_DSC_4513.NEF
Date/Time Original              : 2007:03:25 18:35:16
Create Date                     : 2007:03:25 18:35:16
Modify Date                     : 2007:03:25 18:35:16
File Modification Date/Time     : 2007:03:25 19:35:16
======== 2007-03-25_D50_DSC_4514.NEF
Date/Time Original              : 2007:03:25 18:35:37
Create Date                     : 2007:03:25 18:35:37
Modify Date                     : 2007:03:25 18:35:37
File Modification Date/Time     : 2007:03:25 19:35:37
======== 2007-03-25_D50_DSC_4515.NEF
Date/Time Original              : 2007:03:25 18:35:59
Create Date                     : 2007:03:25 18:35:59
Modify Date                     : 2007:03:25 18:35:59
File Modification Date/Time     : 2007:03:25 19:35:59
======== DSC_1056.NEF
Date/Time Original              : 2008:06:18 15:10:17
Create Date                     : 2008:06:18 15:10:17
Modify Date                     : 2008:06:18 15:10:17
File Modification Date/Time     : 2008:06:18 14:10:17
    4 image files read

***** AT THIS POINT I DISABLED "AUTOMATICALLY ADJUST FOR DAYLIGHT SAVINGS" *****

C:\nefs>exiftool -filemodifydate-=1 *
    4 image files updated

C:\nefs>exiftool -alldates -filemodifydate *
======== 2007-03-25_D50_DSC_4513.NEF
Date/Time Original              : 2007:03:25 18:35:16
Create Date                     : 2007:03:25 18:35:16
Modify Date                     : 2007:03:25 18:35:16
File Modification Date/Time     : 2007:03:25 17:35:16
======== 2007-03-25_D50_DSC_4514.NEF
Date/Time Original              : 2007:03:25 18:35:37
Create Date                     : 2007:03:25 18:35:37
Modify Date                     : 2007:03:25 18:35:37
File Modification Date/Time     : 2007:03:25 17:35:37
======== 2007-03-25_D50_DSC_4515.NEF
Date/Time Original              : 2007:03:25 18:35:59
Create Date                     : 2007:03:25 18:35:59
Modify Date                     : 2007:03:25 18:35:59
File Modification Date/Time     : 2007:03:25 17:35:59
======== DSC_1056.NEF
Date/Time Original              : 2008:06:18 15:10:17
Create Date                     : 2008:06:18 15:10:17
Modify Date                     : 2008:06:18 15:10:17
File Modification Date/Time     : 2008:06:18 12:10:17
    4 image files read

C:\nefs>

Note that with the "auto adjust" turned off, all the times change by 2 hours! This has left me scratching my head a little. Looks like the later version of Pearl may be worthy of consideration.

Archive

[Originally posted by exiftool on 2008-07-18 12:17:57-07]

There is certainly something I still don't understand about the
behavour, but since it appears to be a bug in ActivePerl 5.8.7,
I'm not going to spend any more time trying to figure it out.

Instead, I'm pursuing the Perl upgrade path, but after a number of
hours trying to get the PAR packager working with the updated Perl,
I still haven't got it running yet.  So this may take a while.  I'll
let you know when I have something ready.

 - Phil

Archive

[Originally posted by justin on 2008-07-18 14:31:30-07]

Thanks Phil. If you would like me to do any more testing at any stage I'd be more than happy to oblige

Archive

[Originally posted by exiftool on 2008-07-18 17:10:10-07]

I've got something for you to try out:

https://exiftool.org/exiftool-7.38.zip" target="_blank">exiftool-7.38.zip

This is the same as version 7.37, but bundled with Perl 5.10.0
instead of Perl 5.8.7.  I'm not 100% happy with this for two reasons:

1) Modules that should be included automatically in the package
aren't, so I have to load them explicitly at run time which increases
the time needed to launch exiftool by a small bit.  (I hope to
figure out a way around this.)

2) The new perl is bigger, so the zip file is about 2.4 MB now instead
of 1.9 MB.  But I knew this would happen and there is no way around it.

However, it does seem to fix the DST problem in my tests.

- Phil

Archive

[Originally posted by justin on 2008-07-18 19:51:26-07]

Hi Phil, it looks like you've cracked it! Below, I have tested both setting the -filemodifydate from the -createdate and shifting the -filemodifydate back and forward one hour - all with DST enabled on my machine. As far as I can tell it looks perfect!

Code:
D:\Photos\Library\2007\03\25>exiftool -alldates -filemodifydate *
======== 2007-03-25_D50_DSC_4513.NEF
Date/Time Original              : 2007:03:25 18:35:16
Create Date                     : 2007:03:25 18:35:16
Modify Date                     : 2007:03:25 18:35:16
File Modification Date/Time     : 2007:03:25 19:35:16
======== 2007-03-25_D50_DSC_4514.NEF
Date/Time Original              : 2007:03:25 18:35:37
Create Date                     : 2007:03:25 18:35:37
Modify Date                     : 2007:03:25 18:35:37
File Modification Date/Time     : 2007:03:25 19:35:37
======== 2007-03-25_D50_DSC_4515.NEF
Date/Time Original              : 2007:03:25 18:35:59
Create Date                     : 2007:03:25 18:35:59
Modify Date                     : 2007:03:25 18:35:59
File Modification Date/Time     : 2007:03:25 19:35:59
    3 image files read

D:\Photos\Library\2007\03\25>exiftool "-filemodifydate<createdate" *
    3 image files updated

D:\Photos\Library\2007\03\25>exiftool -alldates -filemodifydate *
======== 2007-03-25_D50_DSC_4513.NEF
Date/Time Original              : 2007:03:25 18:35:16
Create Date                     : 2007:03:25 18:35:16
Modify Date                     : 2007:03:25 18:35:16
File Modification Date/Time     : 2007:03:25 18:35:16
======== 2007-03-25_D50_DSC_4514.NEF
Date/Time Original              : 2007:03:25 18:35:37
Create Date                     : 2007:03:25 18:35:37
Modify Date                     : 2007:03:25 18:35:37
File Modification Date/Time     : 2007:03:25 18:35:37
======== 2007-03-25_D50_DSC_4515.NEF
Date/Time Original              : 2007:03:25 18:35:59
Create Date                     : 2007:03:25 18:35:59
Modify Date                     : 2007:03:25 18:35:59
File Modification Date/Time     : 2007:03:25 18:35:59
    3 image files read

D:\Photos\Library\2007\03\25>exiftool -filemodifydate-=1 *
    3 image files updated

D:\Photos\Library\2007\03\25>exiftool -alldates -filemodifydate *
======== 2007-03-25_D50_DSC_4513.NEF
Date/Time Original              : 2007:03:25 18:35:16
Create Date                     : 2007:03:25 18:35:16
Modify Date                     : 2007:03:25 18:35:16
File Modification Date/Time     : 2007:03:25 17:35:16
======== 2007-03-25_D50_DSC_4514.NEF
Date/Time Original              : 2007:03:25 18:35:37
Create Date                     : 2007:03:25 18:35:37
Modify Date                     : 2007:03:25 18:35:37
File Modification Date/Time     : 2007:03:25 17:35:37
======== 2007-03-25_D50_DSC_4515.NEF
Date/Time Original              : 2007:03:25 18:35:59
Create Date                     : 2007:03:25 18:35:59
Modify Date                     : 2007:03:25 18:35:59
File Modification Date/Time     : 2007:03:25 17:35:59
    3 image files read

D:\Photos\Library\2007\03\25>exiftool -filemodifydate+=1 *
    3 image files updated

D:\Photos\Library\2007\03\25>exiftool -alldates -filemodifydate *
======== 2007-03-25_D50_DSC_4513.NEF
Date/Time Original              : 2007:03:25 18:35:16
Create Date                     : 2007:03:25 18:35:16
Modify Date                     : 2007:03:25 18:35:16
File Modification Date/Time     : 2007:03:25 18:35:16
======== 2007-03-25_D50_DSC_4514.NEF
Date/Time Original              : 2007:03:25 18:35:37
Create Date                     : 2007:03:25 18:35:37
Modify Date                     : 2007:03:25 18:35:37
File Modification Date/Time     : 2007:03:25 18:35:37
======== 2007-03-25_D50_DSC_4515.NEF
Date/Time Original              : 2007:03:25 18:35:59
Create Date                     : 2007:03:25 18:35:59
Modify Date                     : 2007:03:25 18:35:59
File Modification Date/Time     : 2007:03:25 18:35:59
    3 image files read

D:\Photos\Library\2007\03\25>
I understand that moving to a new version of Pearl is not to be taken lightly but in this case, it does seem to resolve the problem. Many thanks for all your help. Justin..

Archive

[Originally posted by exiftool on 2008-07-19 09:57:56-07]

Hi Justin,

Thanks for testing this.  Please let me know if you have any problems.
I think I have come up with a solution for the module loading problem
that won't slow things down, but I have to test it out.  If it works,
version 7.39 will use this technique.  Until then, I have made the
7.38 Windows version public for other people to test out.

- Phil

Archive

[Originally posted by red4 on 2008-08-13 20:30:33-07]

Code:
I've got the same problem really, trying to put an EXIF date tag into some photos that don't
have any.

exiftool appears to be showing local timezone shifted times.

Perl 5.10.0.1003 and exiftool 7.39

Trying to execute this "exiftool.pl "-DateTimeOriginal<filemodifydate" Image025.jpg"

Which does indeed work, but records an offset time in the resulting file.

Archive

[Originally posted by exiftool on 2008-08-15 12:21:36-07]

So it looks like 5.10 didn't solve all the problems.

Red4: what is your time zone?  Is the problem the same for exiftool 7.37?
Does the problem go away if you turn off  "Automatically adjust clock
for daylight savings time" in your Date and Time settings?

Thanks for any help you can provide.

- Phil

Archive

[Originally posted by red4 on 2008-08-15 19:49:49-07]

Code:
Quick answer: turning off "Automatically adjust clock for Daylight Savint Time" in Vista fixes all
the time problems that I've been seeing for the last few days!

OK, I've been experimenting for a while, I think exiftool is working fine on 5.10.  I was
initially running Perl 5.8 but had problems so switched to 5.10 and I think I've tracked down
the culprit to be Windows Vista!  Sorry Phil!

Because I ended up chasing my tail for a bit, I decided to take four test photos with known times
on my camera and see what ended up.  My camera also has a Daylight Saving time setting, which I
believe is superfluous to this, but just wanted to make sure I controlled all the variables.

So I set the cameras clock to 2030 each time and once in summer and once in winter; repeated for
Daylight saving time for completeness.  Notice how Vista shifts the time by an hour in winter time!

The other peculiar effect I've discovered, is that Vista also shifts the File Modification
Date/Time by an hour if the file is copied from the camera during winter time (or when Vistas
local clock is set to winter time).

Is the solution to leave "Automatically adjust clock for Daylight Savint Time" turned off and
manually change Vista's clock twice a year?  Such a pain!!

IMG_1166.JPG:
============

Set on camera: 15.08.2008  2030   Daylight saving time ON

exiftool.pl:
File Modification Date/Time     : 2008:08:15 20:30:12
Date/Time Original              : 2008:08:15 20:30:13
Create Date                     : 2008:08:15 20:30:13
Modify Date                     : 2008:08:15 20:30:13

Photoshop:  exif:DateTimeOriginal: 2008-08-15T20:30:13+01:00

Vista Date Taken: 15/08/2008 20:30

IMG_1167.JPG:
============

Set on camera: 15.11.2008  2030   Daylight saving time ON

exiftool.pl:
File Modification Date/Time     : 2008:11:15 20:30:04
Date/Time Original              : 2008:11:15 20:30:05
Create Date                     : 2008:11:15 20:30:05
Modify Date                     : 2008:11:15 20:30:05

Photoshop:  exif:DateTimeOriginal: 2008-11-15T20:30:05Z

Vista Date Taken: 15/11/2008 21:30

IMG_1168.JPG:
============

Set on camera: 15.08.2008  2030   Daylight saving time OFF

exiftool.pl:
File Modification Date/Time     : 2008:08:15 20:30:04
Date/Time Original              : 2008:08:15 20:30:05
Create Date                     : 2008:08:15 20:30:05
Modify Date                     : 2008:08:15 20:30:05

Photoshop:  exif:DateTimeOriginal: 2008-08-15T20:30:05+01:00

Vista Date Taken: 15/08/2008 20:30

IMG_1169.JPG:
============

Set on camera: 15.11.2008  2030   Daylight saving time OFF

exiftool.pl:
File Modification Date/Time     : 2008:11:15 20:30:04
Date/Time Original              : 2008:11:15 20:30:04
Create Date                     : 2008:11:15 20:30:04
Modify Date                     : 2008:11:15 20:30:04

Photoshop:  exif:DateTimeOriginal: 2008-11-15T20:30:04Z

Vista Date Taken: 15/11/2008 21:30

Archive

[Originally posted by exiftool on 2008-08-17 14:17:18-07]

Thanks for looking into this.  It would be nice if
there were a more convenient solution. https://exiftool.org/forum/Smileys/default/sad.gif" alt="Sad" border="0" />

- Phil

Archive

[Originally posted by exiftool on 2008-08-26 10:49:01-07]

I think I have found the solution, and will revert the Windows version
of exiftool 7.41 to use Perl 5.8 once again.  In this version (to be
released within a few days), I will add a Windows-specific patch that
should fix the timezone problem.

- Phil