# Push notification with upcoming time

**URL:** <https://community.homey.app/t/push-notification-with-upcoming-time/122526>\
**Category:** Flows\
**Tags:** flow\
**Created:** [December 3, 2024, 12:45pm UTC](https://community.homey.app/t/push-notification-with-upcoming-time/122526 "2024-12-03T12:45:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Philip\_W\_daSilva](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/philip_w_dasilva/32/81772_2.png) [@Philip\_W\_daSilva](https://community.homey.app/u/Philip_W_daSilva)\
**Post date:** [December 3, 2024, 12:45pm UTC](https://community.homey.app/t/push-notification-with-upcoming-time/122526/1 "2024-12-03T12:45:43Z")

</div>

Hi!

I’m trying to make a timer that will remind me to do something 2 hours later. I have created a timer with cronograph which will send me a push notication 2 hours later, so that is all fine. But when the timer is started I would like to send a push notifcation saying that the timer is started and that it will finish a certain time, i.e the current time + 2 hours. Is there any way to use the #time variable + 2 hours to get what that time is?

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [December 3, 2024, 11:48pm UTC](https://community.homey.app/t/push-notification-with-upcoming-time/122526/2 "2024-12-03T23:48:46Z")

</div>

The ‘Timey’ app might be what you’re looking for.

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [December 4, 2024, 9:03am UTC](https://community.homey.app/t/push-notification-with-upcoming-time/122526/3 "2024-12-04T09:03:23Z")

</div>

Or have a look at [Better Logic Library App voor Homey | Homey](https://homey.app/nl-nl/app/net.i-dev.betterlogic/Better-Logic-Library/)

---

<div class="post-metadata">

**Author:** ![Philip\_W\_daSilva](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/philip_w_dasilva/32/81772_2.png) [@Philip\_W\_daSilva](https://community.homey.app/u/Philip_W_daSilva)\
**Post date:** [December 7, 2024, 12:16pm UTC](https://community.homey.app/t/push-notification-with-upcoming-time/122526/4 "2024-12-07T12:16:20Z")

</div>

I solved it with homey script in the end. This was the solution:

// Get the current time in UTC  
let now = new Date();

// Convert the current time to local time using Sweden’s time zone  
let localTime = new Date(now.toLocaleString(“sv-SE”, { timeZone: “Europe/Stockholm” }));

// Add 2 hours  
localTime.setHours(localTime.getHours() + 2);

// Add 30 minutes  
localTime.setMinutes(localTime.getMinutes() + 30);

// Format the time without seconds (only HH:MM)  
let formattedTime = localTime.toTimeString().split(‘:’).slice(0, 2).join(‘:’);

// Log the result for debugging purposes  
console.log(‘Time in 2.5 hours:’, formattedTime);

// Return the result to Homey for further use  
return formattedTime;

---

<div class="post-metadata">

**Author:** ![Wim\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wim_post/32/56793_2.png) [@Wim\_Post](https://community.homey.app/u/Wim_Post)\
**Post date:** [December 7, 2024, 2:12pm UTC](https://community.homey.app/t/push-notification-with-upcoming-time/122526/5 "2024-12-07T14:12:56Z")

</div>

![Scherm­afbeelding 2024-12-07 om 15.05.57](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/2/623c7027385264aa1fb2c09a528b78e8b0a3da67.jpeg)

I had to add an extra hour to get the correct time.
