Author Topic: How to convert Date/Time field by changing the Timezone?  (Read 3472 times)

harshavelocity

  • Newbie
  • *
  • Posts: 1
How to convert Date/Time field by changing the Timezone?
« on: May 31, 2012, 01:22:54 AM »
For any type of file's meta data if the modify date or create date is like
2012:05:28 16:30:26+05:30
2011:12:29 15:36:49-04:00...etc 
how can i do a zone conversion i.e how can i design a parser to get all date/time fields to a standard format????


-Harsha

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16724
    • ExifTool Home Page
Re: How to convert Date/Time field by changing the Timezone?
« Reply #1 on: May 31, 2012, 07:49:53 AM »
Hi Harsha,

I assume you are talking about XMP, because EXIF doesn't support timezones.  So let's take the XMP:DateCreated tag as an example...

To convert all values with a timezone of -05:00 to a timezone of +01:00, you could do this:

exiftool -xmp:datecreated+="6+6" -if "$xmp:datecreated=~/-05:00$/" DIR

where DIR is the name of a directory containing the images.  Note: use single quotes instead of double around arguments containing "$" if you are on Mac/Linux.

This will convert one time zone per command.  If you want to do them all in a single command, then it would require a not-so-simple user-defined tag.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).