# Store a date at a specific time and add 7 days

**URL:** <https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049>\
**Category:** Flows\
**Created:** [February 5, 2023, 2:31pm UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049 "2023-02-05T14:31:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthieu\_Moreau](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matthieu_moreau/32/57526_2.png) [@Matthieu\_Moreau](https://community.homey.app/u/Matthieu_Moreau)\
**Post date:** [February 5, 2023, 2:31pm UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/1 "2023-02-05T14:31:13Z")

</div>

Good morning,

I’ve been looking for a while how to store a date at a specific time and add 7 days to it to send me a notification that day.

Anyone got a solution?

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [February 5, 2023, 6:54pm UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/2 "2023-02-05T18:54:48Z")

</div>

The better logic app has some features for saving variables and converting them (back) into date objects.

You can use expressions etc within flowcards.

(Altho, you can also use homeyscript i suppose)

---

<div class="post-metadata">

**Author:** ![Matthieu\_Moreau](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matthieu_moreau/32/57526_2.png) [@Matthieu\_Moreau](https://community.homey.app/u/Matthieu_Moreau)\
**Post date:** [February 5, 2023, 7:13pm UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/3 "2023-02-05T19:13:54Z")

</div>

Do you have some examples ?

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [February 6, 2023, 7:24am UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/4 "2023-02-06T07:24:55Z")

</div>

Well, this for example:  
Create a (i would say ) Number variable in Better Logic (This can be easily done by adding a _Set [number] to_ card and **pressing save** , or goto the BLL app Settings).

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/0/102ac9a220ba56195d99790e612d05428f6ab91f.png)  
After Flowsave, the variable is created.

Now, replace this card with the Set [name] to Expression (BLL expression).  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/9/d9ee5ac3461be2c9772055d66d11275ce0df4508.png)

Now, to fill the variable with the current time(stamp), fill it with the expression `Date.now()`  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/f/cf2777737b1b03e96a44072a19aca28db7be5ae3.png)

This is how you can save a DateTime into a variable.

### To use it and add 7 days, you could do something like this:

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/b/2bde8808e7639bb2827cbedd086118a18e86b8da.png)

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/0/7012990852cbf2fea10237b8ed086be914e6dacf.png)

```auto
new Date([[DateTime]]).setDate(new Date([[DateTime]]).getDate() + 7)

```

Now, the question is, how do you want to use this date?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/7/97c9988a11c1073b000e041d5ca4736cb2a20e46.png)

---

<div class="post-metadata">

**Author:** ![Paul\_van\_Ulft](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/paul_van_ulft/32/56539_2.png) [@Paul\_van\_Ulft](https://community.homey.app/u/Paul_van_Ulft)\
**Post date:** [February 6, 2023, 7:30am UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/5 "2023-02-06T07:30:50Z")

</div>

For storing energie data in google I created a variable dagnummer (daynumber) Every day at 00:01 it restores it. You can also do this wirh year , month etc.

 ![Screenshot 2023-02-06 08.29.10](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/a/bacc735e62f940a31b1bde2b5ad5788104a5a17c.png)

---

<div class="post-metadata">

**Author:** ![Matthieu\_Moreau](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matthieu_moreau/32/57526_2.png) [@Matthieu\_Moreau](https://community.homey.app/u/Matthieu_Moreau)\
**Post date:** [February 6, 2023, 11:53am UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/6 "2023-02-06T11:53:22Z")

</div>

@Arie_J_Godschalk

I will keep sending myself a push message on this new date

[image]

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [February 6, 2023, 12:03pm UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/7 "2023-02-06T12:03:55Z")

</div>

I dont see an image?

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [February 6, 2023, 1:00pm UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/8 "2023-02-06T13:00:20Z")

</div>

> [@Matthieu\_Moreau](#):
>
> I will keep sending myself a push message on this new date

So, you don’t need the specific time?  
Only a way to start a pushmessage in 7 days?

Then i think you can better use @Paul_van_Ulft 's example.

---

<div class="post-metadata">

**Author:** ![Matthieu\_Moreau](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matthieu_moreau/32/57526_2.png) [@Matthieu\_Moreau](https://community.homey.app/u/Matthieu_Moreau)\
**Post date:** [February 6, 2023, 1:23pm UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/9 "2023-02-06T13:23:22Z")

</div>

it is an image error.

No exact time just send a message 7 days later

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [February 6, 2023, 2:08pm UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/10 "2023-02-06T14:08:52Z")

</div>

Maybe you can do something in HomeyScript, here is an example:

> [@\[APP\]\[Pro\] HomeyScript](https://community.homey.app/t/app-pro-homeyscript/854/72):
>
> Here is some code. All data will be given as a tag. De tags you don’t need, just add // in front of ‘await tag’. This will give e.g //await tag(‘CurrentDay’, currentDay); and this tag will not be available var date = new Date(); date.setDate(date.getDate()); const currentDay = date.getDate(); await tag('CurrentDay', currentDay); console.log('1 CurrentDay is: ' +currentDay); const currentMonth = date.getMonth() +1; // getMonth() returns month from 1 to 12 await tag('CurrentMonth', currentMonth)…

---

<div class="post-metadata">

**Author:** ![Matthieu\_Moreau](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matthieu_moreau/32/57526_2.png) [@Matthieu\_Moreau](https://community.homey.app/u/Matthieu_Moreau)\
**Post date:** [February 6, 2023, 2:36pm UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/11 "2023-02-06T14:36:50Z")

</div>

Good morning @JPe4619

yes I could but I would like to avoid scripts as much as possible for personal reasons.

---

<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:** [February 7, 2023, 1:45am UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/12 "2023-02-07T01:45:58Z")

</div>

(With use of the Better Logic Library and Chronograph apps)

When I understand your question correctly, this sends a notification exactly after 7 days at the same hour, along with the trigger’s timestamp:

 ![Screenshot from 2023-02-07 02-55-37](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/c/8cf74b18d9f0a6f906e5662eaa65b615cd0d9087.png)

- Example output when I use a timer duration of minutes instead of days:  
 ![Screenshot from 2023-02-07 03-02-00](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/c/eca3ffe7991c9304c6e4b44d94f0571f28d3b3ff.png)

(Note, this will survive Homey reboots, ~~but probably the time when Chronograph app is not running gets lost. But, the running state gets saved.  
Example, when Chronograph is not running for 30 minutes during a reboot, the timeline notification will be delayed by also 30 minutes → In theory, NOT tested here~~ See reply by Arie below).

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [February 7, 2023, 6:19am UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/13 "2023-02-07T06:19:50Z")

</div>

Not completly, chronograph calculates the finishing time.  
So, if you reboot, the time wil “keep running” untill finished or booted.

---

<div class="post-metadata">

**Author:** ![Torch1969](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torch1969/32/33305_2.png) [@Torch1969](https://community.homey.app/u/Torch1969)\
**Post date:** [February 7, 2023, 7:34am UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/14 "2023-02-07T07:34:46Z")

</div>

I guess this fresh new app can also be used for this:

> **[Action Scheduler](https://homey.app/en-nz/app/fi.oh2th.alarmutils/Action-Scheduler/)**
>
> Dynamic flow scheduling

Create a homey alarm (or schedule device for homey pro 2023) and adjust the alarm time to today + 7 days.  
And when alarm goes, send message.

EDIT: Only time change possible at this moment, so this is no solution (yet) 😳

---

<div class="post-metadata">

**Author:** ![Matthieu\_Moreau](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matthieu_moreau/32/57526_2.png) [@Matthieu\_Moreau](https://community.homey.app/u/Matthieu_Moreau)\
**Post date:** [February 7, 2023, 7:59am UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/15 "2023-02-07T07:59:21Z")

</div>

@Arie_J_Godschalk ,

Thanks, I will test this.

It seems to work even after a reboot.

How to do then so that when the timer is over the action only continues at a scheduled time

---

<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:** [February 7, 2023, 5:41pm UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/16 "2023-02-07T17:41:47Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> Not completly, chronograph calculates the finishing time.

Cool! Didn’t know / tested that yet, Arie 🤠

---

<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:** [February 7, 2023, 5:51pm UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/17 "2023-02-07T17:51:34Z")

</div>

> [@Torch1969](#):
>
> adjust the alarm time to today + 7 days.

I can’t create that with the available flow cards.  
Can you show how you did that?

---

<div class="post-metadata">

**Author:** ![Matthieu\_Moreau](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matthieu_moreau/32/57526_2.png) [@Matthieu\_Moreau](https://community.homey.app/u/Matthieu_Moreau)\
**Post date:** [February 7, 2023, 6:30pm UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/18 "2023-02-07T18:30:18Z")

</div>

Good morning,

I think I found the solution to my problem 🙂

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/7/1767543009e7f193d42f542266f31d56612df9ff.png)

Thank you all

---

<div class="post-metadata">

**Author:** ![Torch1969](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torch1969/32/33305_2.png) [@Torch1969](https://community.homey.app/u/Torch1969)\
**Post date:** [February 7, 2023, 7:05pm UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/19 "2023-02-07T19:05:10Z")

</div>

Well, to be honest, I don’t use this app by myself at this moment, but based on these descriptions, I assumed it would be possible:

> Homey Alarms: Adjust an alarm’s trigger time from a flow to get dynamic alarms.

> With the **action (Then) card** you can modify an existing alarms scheduled time. See the sample advanced flows at the end of this post.

So tested it right away, but you’re right, this is **time** change only, mea culpa 😳

Maybe in future:

> Does not support schedule for dates or months (for now).

---

<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:** [February 8, 2023, 12:04am UTC](https://community.homey.app/t/store-a-date-at-a-specific-time-and-add-7-days/76049/20 "2023-02-08T00:04:43Z")

</div>

Thanks, no mea culpa needed 😉 I just thought I overlooked things. There are cards which takes minutes as value, but they calculate backwards instead of forwards in time at the moment. Thanks for the input though!
