exiv2 -T adjusts file timestamp wrongly
On Tuesday 05 September 2006 23:12, Dave Locke wrote:
This program looks like exactly what I was looking for. Turns out, I did
not reset my camera time to local time when I was touring Asia. I see
that I can add time to the original timestamp. I am also trying to set
the file timestamp to the same time. As I understand,
exiv2 -a9 ad dsc0889.jpg will add 9 hours to the original timestamp,
eg 6/9/2006 09:11 becomes 6/9/2006 18:11
exiv2 -T mn dsc0899.jpg will set file time stamp from the "new"
original timestamp, to 6/9/2006 18:11
Unfortunately, there seems to be a bug (or I don't get how to use it,
which is entirely possible). The -T run does not set the file timestamp
properly. When I run in -v mode, it shows it is updating correct. When
the file timestamp is read by my picture organizer software, it is not
the 6/9/2006 18:11 but is 6 hours earlier 6/9/2006 13:11
Any help you can give would be greatly appreciated.
Updated by Andreas Huggel about 13 years ago
The problem occurs only in Windows; the mktime() system call doesn't take timezone settings from the Control Panel into account.
Workaround: Set the TZ environment variable. Note that the format of TZ is confusing. E.g., here in Malaysia, I set TZ=MYT-8, where MYT is a string to identify the timezone (but it doesn't matter what it is) and -8 because if I add -8 to local Malaysian time I get GMT.