INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Calculating / Adjusting Date/Time Fields  (Read 1351 times)

stricko

  • Galactic Citizen
  • ****
  • Posts: 423
Calculating / Adjusting Date/Time Fields
« on: June 20, 2015, 09:31:12 pm »

OK here's a conumdrum that someone on here must have solved before........ I hope

I'm pulling together a load of images taken by different people on a trip and trying to put them into a proper timeline. 8 different cameras, hundreds of images, but the date/time on the devices was not sync'd before the trip. So we have one camera thinks it's in 2014, another that's one hour behind, smart phones that have adjusted dates due to timezones etc etc. I've manually calculated what I think is an offset for each device, and now want to use it to calculate a new adjusted date/time for each image. Hopefully I can then sort the images into a true time sequence, before removing duplicates etc.

I've added some new fields for the offset, and adjusted date, but I can't quite come up with the necessary expressions to calculate the new values.

I'm hoping someone has had to do this before...... Fingers crossed
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009
Re: Calculating / Adjusting Date/Time Fields
« Reply #1 on: June 20, 2015, 10:25:08 pm »

I'm guessing you want to alter the [Date] field to do this.  You might try this on ONE sample file to prove that it works.  Date calculations turn out to be sort of strange, but they make sense.  Here's the definition of an expression column that I just used as a test:

FormatDate(Math(convertdate([Date]) + 3 + ((20 * 3600 + 5 * 60 + 12)/86400) ), MM//dd//yyyy HH:mm:ss)

Make an expression column with that definition and you can play around with it.  The middle part, with the Math() function is calculating a new date based on the value of the [Date] field.  I'm adding 3 days, 20 hours, 5 minutes, and 12 seconds.  The FormatDate function is being used so we can see the output in a human readable format.  I *think* that for just doing an alteration of a Date type field, you just do the Math() on it and then stuff that back into the correct field.  Something like:

=Math(convertdate([Date]) + 3 + ((20 * 3600 + 5 * 60 + 12)/86400) )

I just tested that and it works on a Music file.  I don't have image support (MC20 for Mac), so I can't test that, but it should be very similar.

Good luck to you.

Brian.
Logged

stricko

  • Galactic Citizen
  • ****
  • Posts: 423
Re: Calculating / Adjusting Date/Time Fields
« Reply #2 on: June 21, 2015, 01:37:02 am »

Genius!!!! Many thanks
Logged

raldo

  • Citizen of the Universe
  • *****
  • Posts: 1102
Re: Calculating / Adjusting Date/Time Fields
« Reply #3 on: June 21, 2015, 04:06:00 am »

Be aware that changing the date/time in MC will not change the date in the file.

I'd suggest that you time shift in another app which writes to the file and then you read the tags in MC.

 Picasa can do this.
Logged
Pages: [1]   Go Up