You were almost there -- just missing how to split the string into its "month", "day" and "year" parts to feed into the TIME()
function.
Oh, and a bit of confusion about token evaluation. The way you were trying will work if you go via a "Filter: Process Tokens" action:
But that's some next-level stuff that quickly leads to %
overload, and not as generally useful as splitting text into variables -- so let's spend a couple of minutes on text-splitting...
There's two easy ways to split text to variables -- treating the text as a psuedo array then access the array's elements by index, and the "Search using Regular Expression" action to pop chunks of your text straight into variables.
We used the pseudo array technique above, with "custom delimiters" to determine the text the elements should be split on. The default delimiter, used when you don't include a custom one, is ,
and your custom delimiter can be a longer string -- you can use =kmSep=
to split "Hello=kmSep=World".
The general pattern is:
%Variable%variable-name[element-index-to-get]custom-delimiter%
Our text, in the variable Local_dateString
, is of the form "month/day/year" so we can split on /
to get three elements -- that's our custom delimiter. "month" is the first element so we can get that with
%Variable%Local_dateString[1]/%
...and, similarly
%Variable%Local_dateString[2]/%
%Variable%Local_dateString[3]/%
...will get us "day" and "year". Which we can then feed into the TIME()
function, remembering that functions are Calculations and take variable names -- Local_month
-- and not text tokens like %Variable%Local_month%
.
Putting that all together:
Demo Date Array Split.kmmacros (4.7 KB)
Image
The regular expression version is much the same, except we can extract all three values in a single action using the regex
(\d+)/(\d+)/(\d+)
...where the first "capture group" is one-or-more consecutive (+
) digits (\d
) before the first /
in our date string, the second is the digits between the two /
s, the third is the digits after the second /
:

Apart from that, this will look very similar to the last:
Demo Date Regex Split.kmmacros (4.4 KB)
Image
Hopefully that explains things so that you can use these methods in other macros -- string splitting is very useful, and very common, so have a play and get comfortable. And if I've confused more than helped -- shout!