ExifTool Forum

ExifTool => Newbies => Topic started by: sunbirdmedia on September 20, 2012, 03:53:46 AM

Title: How to extract date and time?
Post by: sunbirdmedia on September 20, 2012, 03:53:46 AM
Hello,

I've figured out how to extract metadata from my images into a .csv file, but I need separate values for date and time and DateTimeOriginal extracts date and time into the same cell. Is there a way to extract them as separate values, or a way to separate them after the fact?

Thank you!
Jen
Title: Re: How to extract date and time?
Post by: Phil Harvey on September 20, 2012, 08:06:37 AM
Hi Jen,

This can be done with a user-defined Composite tag.  See the sample config file (https://exiftool.org/config.html) for examples.  The ValueConv's to do this are:

    ValueConv => '$val =~ s/ .*//; $val',  # isolate date from date/time value

    ValueConv => '$val =~ s/.* //; $val',  # isolate time from date/time value

- Phil