# Variable for timer duration

**URL:** <https://community.openhab.org/t/variable-for-timer-duration/123058>\
**Category:** Scripts & Rules\
**Tags:** timer, variables\
**Created:** [June 1, 2021, 4:03pm UTC](https://community.openhab.org/t/variable-for-timer-duration/123058 "2021-06-01T16:03:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MartOs](https://community.openhab.org/user_avatar/community.openhab.org/martos/32/64748_2.png) [@MartOs](https://community.openhab.org/u/MartOs)\
**Post date:** [June 1, 2021, 4:03pm UTC](https://community.openhab.org/t/variable-for-timer-duration/123058/1 "2021-06-01T16:03:12Z")

</div>

What do I need to do to make this variable be accepted?

```auto
val timerDuration = Item.state //item is a Number item

myTimer = createTimer(now.plusMinutes(timerDuration), [ |
    //do something
])

```

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [June 1, 2021, 4:10pm UTC](https://community.openhab.org/t/variable-for-timer-duration/123058/2 "2021-06-01T16:10:54Z")

</div>

Make it into an integer, .`intValue` is useful here as shown in many forum examples.
