ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Alan Clifford on March 09, 2011, 05:44:42 PM

Title: -d difference between Mac and Linux
Post by: Alan Clifford on March 09, 2011, 05:44:42 PM
exiftool -m -T -d "%p %r" -datetimeoriginal ahc_0615.jpg

gives "pm 12:36:45 pm" on the Mac

but " 12:36:45" on Linux Slackware 11.

Is it worth a note in the documentation?

A bit irritating as I was writing the script on my mac and moved it to the Linux computer to be used :-(

Alan
Title: Re: -d difference between Mac and Linux
Post by: Phil Harvey on March 09, 2011, 06:23:50 PM
Hi Alan,

This is already documented the best I can:

Consult "strftime" man page for FMT syntax.

So typing man strftime should give you everything you need.

Or did you just want me to document the fact that strftime depends on the system and locale settings?

- Phil

Edit:  I think this may be better, how does it sound to you?:

−d FMT (−dateFormat)
Set the format for date/time tag values.  The specifics of the FMT syntax
are system dependent -- consult the "strftime" man page on your system for
details.  The default format is equivalent to "%Y:%m:%d %H:%M:%S".  This
option has no effect on date-only or time-only tags and ignores timezone
information if present.  Only one -d option may be used per command.  The
inverse operation (ie. un-formatting a date/time value) is currently not
applied when writing a date/time tag.
Title: Re: -d difference between Mac and Linux
Post by: Alan Clifford on March 09, 2011, 07:06:12 PM
I'm not being very clear again.

The documentation for strftime on my Linux system gives the %p and %r options.  They just don't seem to work with exiftool on that system.

Alan
Title: Re: -d difference between Mac and Linux
Post by: Phil Harvey on March 10, 2011, 07:10:22 AM
Hi Alan,

I'm sorry, but I don't think I can help with this.  ExifTool uses the standard POSIX strftime routine so I have no control over what works on which systems.  On my Linux system here I get this:

> exiftool -d "%p %r" test.jpg -filemodifydate
File Modification Date/Time     : AM 07:51:27 AM


- Phil