New Variables (was: Metadata Templates)

Started by Mach325, July 30, 2013, 11:13:06 AM

Previous topic - Next topic

Mach325

Good Morning,

I have been playing around with Metadata Templates and they are great. A couple of questions:

1. Is there an easy method of obtaining an AM or PM value from the {File.DateTime} tag, based upon whether a photo was taken during the morning or afternoon?
2. Is there an easy method of obtaining the century and decade in which a photo was taken from the {File.DateTime} tag?

Thank you.

Mario

You can use formatting functions to extract parts of the date/time or produce a custom format. See variables in the help. Unfold the table of contents at the top and click on Formatting.

Start with

1. {File.DateTime|format:XLT}
2. {File.DateTime|format:YY}

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mach325

Hi,

Thank you for this response.

The XLT provide the local time in the format 12:00:00. I am after am AM or PM indicator. Photo Mechanic provides a variable called AMPM which is set to AM when a photo is taken before noon and to PM for photos taken after noon.

The {File.DateTime|format:YY} will return 20, which is actually the 21st Century. Could a variable be provided for the Century so if {File.DateTime|format:YY} = 19, the century variable is set to 20th Century and {File.DateTime|format:YY} = 20 the century variable returns 21st Century?

Please could a decade variable be provided to return the first year of the decade? E.g:

Photos taken between the years 1990-1999 - the decade variable would be set to 1990.
Photos taken between the years 2000-2009 - the decade variable would be set to 2000.
Photos taken between the years 2010-2019 - the decade variable would be set to 2010.
Photos taken between the years 2020-2029 - the decade variable would be set to 2020.

Thank you.

Mario

This should be doable using the numcomp and between formatting functions introduced in version 5.4.12.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook