Skip Menu |

This queue is for tickets about the Image-ExifTool CPAN distribution.

Report information
The Basics
Id: 19792
Status: resolved
Priority: 0/
Queue: Image-ExifTool

People
Owner: Nobody in particular
Requestors: tuzen [...] hotmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 6.17
Fixed in: 6.29



Subject: unexpected date format when -d is specified
I am using ActiveState perl 813 on WinXP SP2. When I run the command- line below to format the output of a single tag it appears my arguments are ignored. The -d argument appears to work if I do not specify the tag. C:\perl exiftool -DateCreated -d "%m-%d-%Y" c:\sample.NEF Results: Date Created : 2006:01:10 Expected: Date Created : 1-10-2006 Thanks!
This is the current design. The -d option only works on date/time tags, not date-alone tags. If there is a corresponding TimeCreated tag, then the composite DateTimeCreated tag will also exist. If so, this would work: C:\perl exiftool -DateTimeCreated -d "%m-%d-%Y" c:\sample.NEF The restriction is because the strftime function requires a date and time. I suppose I could pass it 00:00 for the time of date-only tags, and maybe this is the way to go since this would give the behaviour that you expected. So I'll look into changing this, and unless there is a problem you should see this update in version 6.24 when it is released.
Ah, I remember the problem... If -d is used to reformat the date/time tags, ie) exiftool -d "%m-:%Y-%d %H:%M:%S" Then the date/time tags will show up properly, but the date-only tags will appear with a bogus time of 00:00:00, which may be misleading. Unfortunately there is no simple way to strip the time out of the result for date-only tags, so this problem can't be avoided. I'd like to hear what you (and other people) think about this, but because of this problem I think it is safest to keep -d so it works only on date/time tags. I know this bug system isn't really conducive to a discussion, but I think I need some input on this one.
Subject: RE: [rt.cpan.org #19792] unexpected date format when -d is specified
Date: Thu, 08 Jun 2006 18:56:40 -0700
To: bug-Image-ExifTool [...] rt.cpan.org
From: "Brian Williams" <tuzen [...] hotmail.com>
Ah, I hadn't realized that these fields would behave differently. Ideally, I guess I would have expected nothing, "" (blank) output for %H:%M:%S''. I am guessing a bogus time might cause more questions than using the real time. Looking more closely, I noticed that the two examples I have here both include a separate time element. Date Created : 2000:07:22 Time Created : 14:58:21-07:00 Release Date : 2006:01:10 Release Time : 14:49:49-08:00 I tested the example you mentioned: C:\>perl exiftool -DateTimeCreated c:\sample.NEF -d "%m-%d-%y" Date/Time Created : 07-22-00 This works great, but I was aiming for the -IPTC:DateCreated tag... Show quoted text
>From: " via RT" <bug-Image-ExifTool@rt.cpan.org> >Reply-To: bug-Image-ExifTool@rt.cpan.org >To: tuzen@hotmail.com >Subject: [rt.cpan.org #19792] unexpected date format when -d is specified >Date: Thu, 8 Jun 2006 13:44:17 -0400 (EDT) >MIME-Version: 1.0 > > ><URL: http://rt.cpan.org/Ticket/Display.html?id=19792 > > >Ah, I remember the problem... If -d is used to reformat the date/time >tags, ie) > >exiftool -d "%m-:%Y-%d %H:%M:%S" > >Then the date/time tags will show up properly, but the date-only tags will >appear with a >bogus time of 00:00:00, which may be misleading. Unfortunately there is no >simple way to >strip the time out of the result for date-only tags, so this problem can't >be avoided. > >I'd like to hear what you (and other people) think about this, but because >of this problem I >think it is safest to keep -d so it works only on date/time tags. > >I know this bug system isn't really conducive to a discussion, but I think >I need some input >on this one. >
Thanks for your feedback. After sleeping on it, I think it is best not to go with the bogus time idea. However, I will add a note in the documentation to hopefully avoid this confusion in the future. At some point I may add the ability to format date-only and time-only values, but it will need to be a new option to avoid conflict with the -d formatting.