ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: trymeout on May 25, 2021, 12:36:43 AM

Title: Remove timezone from Content Create Date
Post by: trymeout on May 25, 2021, 12:36:43 AM
Hello,

Is there a easy way to remove the timezone from the "Content Create Date " metadata date and time field?

Change it from this

Content Create Date             : 2022:11:22 12:00:00-06:00


And change it to this without reentering the date and time.

Content Create Date             : 2022:11:22 12:00:00

Is there a simple command that can do this to save time from having to reenter the date and time?

Thanks in advanced
Title: Re: Remove timezone from Content Create Date
Post by: Luuk2005 on May 25, 2021, 05:14:13 AM
Can use a s/match/replace/ like...  -ContentCreateDate"<${ContentCreateDate; s/-.*//}"
Title: Re: Remove timezone from Content Create Date
Post by: StarGeek on May 25, 2021, 11:42:50 AM
Quote from: Luuk2005 on May 25, 2021, 05:14:13 AM
Can use a s/match/replace/ like...  -ContentCreateDate"<${ContentCreateDate; s/-.*//}"

This won't work with versions 12.13+.  Because Apple will display wildly inaccurate dates when there isn't a timezone present in the string based Quicktime date/time tags, exiftool will automatically add the local time zone to the date if a time zone isn't included.  The can be suppressed with the -n (--printConv) option (https://exiftool.org/exiftool_pod.html#n---printConv) or its hashtag # shorthand.
exiftool "-ContentCreateDate#<${ContentCreateDate; s/-.*//}" /path/to/files/
Title: Re: Remove timezone from Content Create Date
Post by: trymeout on May 25, 2021, 12:25:15 PM
This does work with any timezone before 00:00, but it will not work with timezones that are after 00:00 such as +05:00.
Title: Re: Remove timezone from Content Create Date
Post by: StarGeek on May 25, 2021, 12:55:33 PM
Ah, yes, try this
exiftool "-ContentCreateDate#<${ContentCreateDate; s/[+-].*//}" /path/to/files/

C:\>exiftool -g1 -a -s -ContentCreateDate "Y:\!temp\Test1.mp4"
---- ItemList ----
ContentCreateDate               : 2021:05:25 09:53:30-07:00

C:\>exiftool -P -overwrite_original "-ContentCreateDate#<${ContentCreateDate; s/[+-].*//}" "Y:\!temp\Test1.mp4"
    1 image files updated

C:\>exiftool -g1 -a -s -ContentCreateDate "Y:\!temp\Test1.mp4"
---- ItemList ----
ContentCreateDate               : 2021:05:25 09:53:30

C:\>exiftool -P -overwrite_original -all= -ContentCreateDate="2021:05:25 09:53:30+07:00" "Y:\!temp\Test1.mp4"
    1 image files updated

C:\>exiftool -g1 -a -s -ContentCreateDate "Y:\!temp\Test1.mp4"
---- ItemList ----
ContentCreateDate               : 2021:05:25 09:53:30+07:00

C:\>exiftool -P -overwrite_original "-ContentCreateDate#<${ContentCreateDate; s/[+-].*//}" "Y:\!temp\Test1.mp4"
    1 image files updated

C:\>exiftool -g1 -a -s -ContentCreateDate "Y:\!temp\Test1.mp4"
---- ItemList ----
ContentCreateDate               : 2021:05:25 09:53:30
Title: Re: Remove timezone from Content Create Date
Post by: trymeout on May 25, 2021, 01:58:22 PM
Thank you, this works for me