I have a date time in a variable: 2025-04-14T04:00:00Z
I don't THINK I can reformat that in KM (as a date) in that format
How can I convert that so I can reformat it in KM as: Monday 4/14 4 AM
I have a date time in a variable: 2025-04-14T04:00:00Z
I don't THINK I can reformat that in KM (as a date) in that format
How can I convert that so I can reformat it in KM as: Monday 4/14 4 AM
This is probably solved easily using the information on the following page.
https://wiki.keyboardmaestro.com/token/ICUDateTime
I'm reading the page now to see if I can solve it for you.
Probably not the most efficient, but I can make it work this way
Use the substring method to get each part from the 8601 date into a separate variable
(Year, Month, Day, Time)
Then use those variables to build what I want with TIME()
%ICUDateTimeFor% TIME(Year, Month, Day, Time,0,0) %EEEE M/d h a%
Well, if you want to break it up manually, you can try this:
And if you follow the above action with the following, it seems to work:
Although I thought there would be a way to do it in a single step, but if this works, that's good enough.
Thanks!
Using the Search Variable with regex is cleaner so I used that
The only other thing I needed to add was GMTOFFSET() because I have a negative GMT offset
%ICUDateTimeFor% TIME(Year, Month, Day, Hour,0,0)-GMTOFFSET() %EEEE M/d h a%
And another approach is to get the ICU Date Time from the Unix seconds:
Oh, nice, thanks!
See also, more generally: