How to Convert Date From a Unix Data to yyyyMMdd Format

Sorry if this is an question that has been covered already, but i cannot find my answer even after reading the forum for a few hours.

I want to display a Creation Date of a file (which is a variable) into some actions.
I use this:

See that it's output is a number, i reckon its the date in the UNIX format.
I want it to be converted to yearmonthday. So; yyyyMMdd

How do i do that? I guess (hope) it is very simple but i can't find out how.

Just use the ICUDateTimeFor token.

Here's an example:

MACRO:   Using File Date/Time from KM File Filter


#### DOWNLOAD:
<a class="attachment" href="/uploads/default/original/3X/4/1/41b65ba7120b14e989ca86075f6bb0e6937e7af7.kmmacros">Using File Date-Time from  KM File Filter.kmmacros</a> (2.7 KB)
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**

---



![image|540x606](upload://cs2SYFc5h1Mwz031TRiV2y4taS5.png)

I knew it was that simple. I think i even tried this but i must have made a (tiny) mistake so i did not work.
Thanks a lot!

This is great and exactly what I was looking for too. BUT I can't find the "Convert Unix Date/Time to ISO Date/Time Format" action in the action list. I was able to accomplish what I needed by downloading your macro and copying the action, but the action itself doesn't seem to be part of the installed actions... am I missing something?

That is simply the Title I gave that action, which is simply the Set Variable to Text action.

I often re-title my Actions to provide a description of what it does.
To re-title, click on the Gear menu in the upper right of the Action, and select "Rename".

The real work in this Action is done by the ICUDateTimeFor token.

Thanks! That makes sense now. :grinning:

How do i do the opposite of the original question?

I want to convert an ISO date (yyyyMMdd) to unix time.

Ok, after a day I found my own answer.

Here is an example:

image