# How to set a timer which activates ... days before set date

**URL:** <https://forum.camunda.io/t/how-to-set-a-timer-which-activates-days-before-set-date/51577>\
**Category:** Discussion & Questions\
**Tags:** workflow-execution\
**Created:** [April 3, 2024, 10:00am UTC](https://forum.camunda.io/t/how-to-set-a-timer-which-activates-days-before-set-date/51577 "2024-04-03T10:00:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohritz](https://forum.camunda.io/user_avatar/forum.camunda.io/mohritz/32/28501_2.png) [@mohritz](https://forum.camunda.io/u/mohritz)\
**Post date:** [April 3, 2024, 10:00am UTC](https://forum.camunda.io/t/how-to-set-a-timer-which-activates-days-before-set-date/51577/1 "2024-04-03T10:00:36Z")

</div>

Hey there,

I am still really new to the Camunda Modeler and ran into a problem which I, up until now, couldn’t solve myself.  
I got a task in which a user has to fill out a form, if the user doesn’t complete the task with in 28 days before a set date he should receive a mail, reminding him to complete it.

My problem is, that I can’t get the timer to work properly.  
I have a variable (arbeit\_ab), which is the set date, on which the task has to be completed.  
For some odd reason, I haven’t figured out, how to subtract the 28 days from the variable arbeit\_ab.

So far I have tried some of the following:  
${arbeit\_ab} - P28D  
${arbeit\_ab - 28}  
${arbeit\_ab.minusDate(28)}

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![rohwerj](https://forum.camunda.io/user_avatar/forum.camunda.io/rohwerj/32/33352_2.png) [@rohwerj](https://forum.camunda.io/u/rohwerj)\
**Post date:** [April 3, 2024, 3:52pm UTC](https://forum.camunda.io/t/how-to-set-a-timer-which-activates-days-before-set-date/51577/2 "2024-04-03T15:52:31Z")

</div>

Hi @mohritz.

Please have a look at this solution to a related question

> [@How to add days to a date variable in a service task](https://forum.camunda.io/t/how-to-add-days-to-a-date-variable-in-a-service-task/22488/2):
>
> @solo812 try expression like this below: ${dateTime().withMillis(dueDateField.getTime()).plusDays(10).toDate()} Deploy this bpmn and test: [DateCalculationProcess.bpmn](https://forum.camunda.io/uploads/short-url/u7MfvVxRpflhHsEPZobWEQHLbxu.bpmn) (2.9 KB)

So the expression should be like this:

```auto
${dateTime().withMillis(arbeit_ab.getTime()).minusDays(28).toDate()}

```

Alternatively you could call a bean method via the expression and calculate the date in the code.
