Hey Mahdu,
I think you're juxtaposing setting a variable to text and setting a variable to a calculation.
In future please post your work, so we can see/test the actual macro – it saves everyone time and aggravation.
If you haven't read these they're worth a couple of minutes of your time:
Tip: How Do I Get The Best Answer in the Shortest Time?
How to Post Your Macro to the Forum
Here's how to do what you want in text fields:
Keyboard Maestro Actions.kmactions (567 B)
It gets more interesting when you try to do date math in calculation fields.
REF:
Set Variable to Calculation action
-Chris