# Create/set alarm via flow/HomeyScript?

**URL:** <https://community.homey.app/t/create-set-alarm-via-flow-homeyscript/76639>\
**Category:** Flows\
**Created:** [February 19, 2023, 9:11am UTC](https://community.homey.app/t/create-set-alarm-via-flow-homeyscript/76639 "2023-02-19T09:11:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [February 19, 2023, 9:11am UTC](https://community.homey.app/t/create-set-alarm-via-flow-homeyscript/76639/1 "2023-02-19T09:11:49Z")

</div>

Is it possible to create or change an alarm from flow using HomeyScript?  
I haven’t found something in the SDK yet.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [February 19, 2023, 9:36am UTC](https://community.homey.app/t/create-set-alarm-via-flow-homeyscript/76639/2 "2023-02-19T09:36:26Z")

</div>

```auto
await Homey.alarms.createAlarm({
  alarm: {
    id: 'my-alarm',
    name: 'My Alarm',
    time: '12:34'
  }
})

```

See [the Web API documentation](https://athombv.github.io/node-homey-api/HomeyAPIV2.ManagerAlarms.Alarm.html).

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [February 19, 2023, 9:39am UTC](https://community.homey.app/t/create-set-alarm-via-flow-homeyscript/76639/3 "2023-02-19T09:39:04Z")

</div>

Thanks, Robert. I only looked at teh SDK, not at WebAPI.

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [February 19, 2023, 1:24pm UTC](https://community.homey.app/t/create-set-alarm-via-flow-homeyscript/76639/4 "2023-02-19T13:24:17Z")

</div>

Isn’t there a Manager.clock to read the timezone? I only have a UTC time and need to convert to local time.  
In the app I use:

```auto
            let tz = this.homey.clock.getTimezone();
            now = new Date().toLocaleString(this.homey.i18n.getLanguage(), 
            { 
                hour12: false, 
                timeZone: tz,
                hour: "2-digit",
                minute: "2-digit",
                day: "2-digit",
                month: "2-digit",
                year: "numeric"
            });

```

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [February 19, 2023, 5:15pm UTC](https://community.homey.app/t/create-set-alarm-via-flow-homeyscript/76639/5 "2023-02-19T17:15:39Z")

</div>

```auto
const { timezone } = await Homey.system.getInfo();

```

[doc](https://athombv.github.io/node-homey-api/HomeyAPIV2.ManagerSystem.html#getInfo)
