-d difference between Mac and Linux

Started by Alan Clifford, March 09, 2011, 05:44:42 PM

Previous topic - Next topic

Alan Clifford

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

Phil Harvey

#1
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.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Alan Clifford

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

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).