I regularly need to convert unix (epoch) time to human readable. I would love if there was a macro or action that could do this for me. Currently, I use an online converter: https://www.epochconverter.com/
Is there some way KM can convert epoch time to PST?
Yes, you should be able to use the ICUDateTimeFor token for this. If you're in the PST time zone yourself, you can also use the GMTOFFSET() function with it to get human readable PST time. See the Dates and Times page on the KM wiki for more information.
Probably I’m missing the real issue (I’m a bit out of KM practice), but for my time zone the KM expression gives the same result as epochconverter.com:
In KM (without the milliseconds)…
%ICUDateTimeFor%1613740332%EEE MMM dd HH:mm:ss z yyyy%
I was creating a macro that got the modification date for a file, and it comes in as the Unix epoch time (localized for my time zone). That's great, I understand epoch time and why it's used, etc.
I thought it'd be trivial to convert that epoch time to some readable format in KM. But no (at least not for me); after 30 minutes of frustration, here's what I wound up doing:
This worked great, and I was on my way. But what's the right way to do it, when the time value is stored in a variable? I'm pretty sure I should be using ICUDateTimeFor, but I could not make anything work. I know you can't reference (easily, at least) a variable in the token, so how am I supposed to be doing this?
Source time zone is Pacific. Yea, that works. I just couldn't make it work earlier, no idea why. Still, I might switch my perl script out for the bash version above—super simple, and it's already adjusted for the local time zone.
Thanks so much for this. There are a few steps that I can't figure out. How would I add the human readable format to the beginning of a selection of the epoch filenames in Finder?