Author Topic: Changing only Year using AllDates Command  (Read 3452 times)

elcinnamonb

  • Newbie
  • *
  • Posts: 4
Changing only Year using AllDates Command
« on: February 27, 2015, 10:26:04 AM »
I'm trying to change the year only using the command AllDates.

This is what I think it would look like, but it's not working

-AllDates-='-8:0:0'

I want to change an image, say, from 2011-07-21 at 00-49-36 to 2003-07-21 at 00-49-36

What's the right command?
Otherwise, what's a good command to get this done? Thank you very much.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14554
    • ExifTool Home Page
Re: Changing only Year using AllDates Command
« Reply #1 on: February 27, 2015, 10:33:52 AM »
To subract 8 years, use -alldates-="8:0:0 0"

(Here I used double quotes so it will also work in Windows.  The single quotes would only work in Mac/Linux.)

Read here for all the details.

- 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 ($).

abalter

  • Jr. Member
  • **
  • Posts: 15
Re: Changing only Year using AllDates Command
« Reply #2 on: March 05, 2015, 05:46:22 PM »
I tried it, and it changed all the times to 00:00:00. I also tried just using "YYYY:MM:DD" and got an error.

Code: [Select]
C:\Users\abalter\Documents\Image-ExifTool-9.88\testimages>exiftool -FileCreateDate="2015:03:05" -FileModifyDate="2015:03:05" *
Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in File:FileCreateDate (PrintConvInv)
Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in File:FileModifyDate (PrintConvInv)
Nothing to do.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14554
    • ExifTool Home Page
Re: Changing only Year using AllDates Command
« Reply #3 on: March 05, 2015, 07:47:52 PM »
I'm confused.  You say that the command I posted changed the times to 00:00:00?  I don't see how that is possible.

Also, in your last post you are now trying to write date/time tags, but you have only specified the date.

- 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 ($).

abalter

  • Jr. Member
  • **
  • Posts: 15
Re: Changing only Year using AllDates Command
« Reply #4 on: March 05, 2015, 11:14:00 PM »
So here is my experiment:
1) Explicitly set YYYY:MM:DD HH:MM:SS
2) Display to confirm
3) Try to set just YYYY:MM:DD using ="2015:03:05 0"
4) Display to confirm

Code: [Select]
C:\Users\abalter\Documents\Image-ExifTool-9.88\testimages>exiftool -FileCreateDate="2013:04:05 06:07:08" -FileModifyDate="2013:04:05 06:07:08" IMG_8220.JPG
    1 image files updated

C:\Users\abalter\Documents\Image-ExifTool-9.88\testimages>exiftool -system:time:all IMG_8220.JPG
File Modification Date/Time     : 2013:04:05 06:07:08-07:00
File Access Date/Time           : 2013:04:05 06:07:08-07:00
File Creation Date/Time         : 2013:04:05 06:07:08-07:00

C:\Users\abalter\Documents\Image-ExifTool-9.88\testimages>exiftool -FileCreateDate="2015:03:05 0" -FileModifyDate="2015:03:05 0" IMG_8220.JPG
    1 image files updated

C:\Users\abalter\Documents\Image-ExifTool-9.88\testimages>exiftool -system:time:all IMG_8220.JPG
File Modification Date/Time     : 2015:03:05 00:00:00-08:00
File Access Date/Time           : 2015:03:05 00:00:00-08:00
File Creation Date/Time         : 2015:03:05 00:00:00-08:00

Sorry to keep bugging you!  I just really want to know how to do this.

Thanks, Ari

Hayo Baan

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 974
  • Professional Photographer & Software Developer
    • Hayo Baan – Photography
Re: Changing only Year using AllDates Command
« Reply #5 on: March 06, 2015, 03:51:30 AM »
The commands you use and the output they generated is exactly what I would expect. What would you want to see happen instead?
Hayo Baan – Photography
Web: www.hayobaan.nl

abalter

  • Jr. Member
  • **
  • Posts: 15
Re: Changing only Year using AllDates Command
« Reply #6 on: March 06, 2015, 03:42:29 PM »
I'm trying to keep the HH:MM:SS of the original file. Parallel discussion going on here

http://u88.n24.queensu.ca/exiftool/forum/index.php?board=12.0

Maybe you have some insight.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14554
    • ExifTool Home Page
Re: Changing only Year using AllDates Command
« Reply #7 on: March 07, 2015, 07:35:53 AM »
Hi Ari,

To keep the original time, you could do this:

exiftool "-FileCreateDate<2015:03:05 ${filecreatedate;s/.* //}" ...

Search for "advanced formatting" in the application documentation for more information.

- 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 ($).

abalter

  • Jr. Member
  • **
  • Posts: 15
Re: Changing only Year using AllDates Command
« Reply #8 on: March 24, 2015, 12:06:26 AM »
Hi Phil,

That did it!

Thanks,

Ariel