Customizable Date variables in Keyboard Maestro

UPDATE: Though the solution below works well, I do recommend following the first commenter’s advice and using the ICUDateTime text tokens instead, which allow you to use any ICU date format, without having to invoke a shell script.

Sometimes you need a date and/or time variable in your Keyboard Maestro macros. The easiest One way I’ve found to do this is via an “Execute Shell Script” action. You’ll just use the date command and format as desired.

Keyboard Maestro "Date" Variable

Tagged with: , ,
Posted in Tech Tips
2 comments on “Customizable Date variables in Keyboard Maestro
  1. Check out the ICUDateTime token in Keyboard Maestro, eg %ICUDateTime%yyyyMMddhhmmss%. See the ICU reference link in the Keyboard Maestro Help menu for more options.

    BTW, you can get the date two business days from now with:

    %ICUDateTimePlus%(DOW() = 5 | DOW() = 6) ? 4 : 2%Days%EEE, MMM d, yyyy h:mm%

    Well, that will work for any weekday – it will return Monday if the current day is Saturday, but what are you doing working on a Saturday!

  2. adam says:

    Thanks for the tip, Peter! I’m a bit embarrassed that I missed this! I’ve updated my post.

Leave a Reply

Your email address will not be published. Required fields are marked *

*