Enter Today's Date + a certain number of days

As the title says I want to Enter Today’s Date + a certain number of days.

The certain # of days will a variable that I can enter in with an Input from User text box at the beginning of the Macro or during it.

I’m new to creating Macros with Keyboard Maestro and the ones I have done so far have started from a recording of keyboard entries that I have tweaked.

I think this needs to start from scratch and I’m not sure where to begin.

Thanks;

Steve

Welcome to Keyboard Maestro! I think you'll find this to be a friendly place to ask your questions, and share the cool macros you will soon be creating.

Have you seen Dates and Times (KM Wiki)?

Since you're new to Keyboard Maestro, here's a complete macro to get you started. You may need to make adjustments to fit your needs.

The key is this "Set Variable" date formula:
%ICUDateTimePlus%DAT__Days%Days%EEE, MMM d, yyyy h:mm%

which ADDS time to the current date. You can easily get this from the "Insert Token" popup:

which will insert this into the text field of the Set Variable Action:
%ICUDateTimePlus%3*7%Days%EEE, MMM d, yyyy h:mm%

One trick is knowing how to use a KM Variable in this formula.
Like any formula you just use the Variable Name, without the "%".
So, replace "3*7" with "my_KM_Variable_name"
%ICUDateTimePlus%my_KM_Variable_name%Days%EEE, MMM d, yyyy h:mm%

Since the Variable I used in the below macro is named "DAT__Days", it results in:
%ICUDateTimePlus%DAT__Days%Days%EEE, MMM d, yyyy h:mm%

Please let us know if you have any further questions.


###MACRO:   @Date Add Time to Current Date @Example

~~~ VER: 1.0    2017-06-09 ~~~

####DOWNLOAD:
<a class="attachment" href="/uploads/default/original/2X/a/a90a4c2d5737b7d0506b15f2aba461ab88194e66.kmmacros">@Date Add Time to Current Date @Example.kmmacros</a> (3.3 KB)
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**

---

<img src="/uploads/default/original/2X/f/f03c4b8b48553c8a832cebc0ccb5c3c24cf0caa0.png" width="549" height="791">

Thank you JMichaelTX;

Wow, that made my head spin.
I’m really not that techy, but I will try to sit down and take a look at it again in a bit.
Right now I am up to my eyeballs trying to setup something else up for my wife’s Amazon Fire TV Stick.

Thanks again;

Steve

Ok, so I tweaked what you gave me and got something very close to what I want it to do.
I want to enter the new date into a text field in MM/DD/YY format.
The result that I'm getting when I add 3 days to today's date (being 06/09/17) is 06/163/17 rather than 06/12/17.

Thanks again;

Steve

1 Like

I got it after looking at the Dates and Times (KM Wiki).

It sould be %ICUDateTimePlus%DAT__Days%Days%MM/dd/yy% rather than %ICUDateTimePlus%DAT__Days%Days%MM/DD/YY%

Thanks;

Steve

1 Like

Great! Glad you figured it out. The KM Wiki is really a great resource.

Just so you know, anywhere in the KM Editor menus for things like tokens, functions, actions, etc, you can hold down the OPTION key while showing the menu, and it will transform into links to Wiki Help articles. Also, in the Gear Menu for Actions, there is a Help item.

If one of the above posts solves your problem/question as originally stated, please check the "Solved" checkbox (click for details) at the bottom of that post.

Otherwise, please post your remaining questions/issues about this problem.
If you have other questions, please start a new topic.