# Calculate date of tomorrow

**URL:** <https://community.homey.app/t/calculate-date-of-tomorrow/16339>\
**Category:** Questions & Help\
**Created:** [August 2, 2019, 11:38am UTC](https://community.homey.app/t/calculate-date-of-tomorrow/16339 "2019-08-02T11:38:11Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![Edgar](https://avatars.discourse-cdn.com/v4/letter/e/b487fb/32.png) [@Edgar](https://community.homey.app/u/Edgar)\
**Post date:** [September 19, 2020, 9:05am UTC](https://community.homey.app/t/calculate-date-of-tomorrow/16339/21 "2020-09-19T09:05:54Z")

</div>

By The Way… what i have made now, is a fully automated alarmclock.  
i add my schedule to apple agenda and with icalCalendar i can now know if i have to work tomorrow or not. before i go to sleep i will get an daily update via google hub. it tells me the temperature, how much power i have collected today, if i have to work or not, etc…  
then, the next morning, my alarm will go off 1 hour before i have to start to work. only thing i have to do is adding the schedule.

this was needed coz icalcalender only checks the next event and collect its date. now i can verify if that date is tomorrow or not. as long as that date is not the same, i don’t have to work the next day 🙂  
At the time 4.30 i run that homeyscript to determine the next day date.

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [March 20, 2023, 10:31pm UTC](https://community.homey.app/t/calculate-date-of-tomorrow/16339/22 "2023-03-20T22:31:20Z")

</div>

> [@JPe4619](#):
>
> For the Day of week:

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/e/fe54ddfd34e7b7a758654d8609ae503129b3993c.png)

Happy to have found your script for the day of the week, but it returns the wrong day for me.  
This may be related to time zone? I am 1 hour later than Western Europe. Its after midnight and I just ran it, it still says Monday, but it is Tuesday already.

Was something deprecated? Any other idea?

---

<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:** [March 21, 2023, 12:10am UTC](https://community.homey.app/t/calculate-date-of-tomorrow/16339/23 "2023-03-21T00:10:58Z")

</div>

It only works well after it is midnight in Londen I’m afraight.

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [March 21, 2023, 12:33am UTC](https://community.homey.app/t/calculate-date-of-tomorrow/16339/24 "2023-03-21T00:33:07Z")

</div>

Thank you. I will do it the old fashioned way. 😇

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/4/0414a37935404ab8635ee8e17ed867280a8c6274.png)

---

<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:** [March 22, 2023, 6:28pm UTC](https://community.homey.app/t/calculate-date-of-tomorrow/16339/25 "2023-03-22T18:28:03Z")

</div>

@Rrrr you can use the BetterLogic Library flowcard: format date.  
Fill it with ddd or dddd and you will get the day, based on your timezone (can be configured or overruled).

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

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [March 24, 2023, 12:14am UTC](https://community.homey.app/t/calculate-date-of-tomorrow/16339/26 "2023-03-24T00:14:47Z")

</div>

That is by far the most elegant way, thank you.

I read the BLL support pages in the app settings.  
Can you calculate date of tomorrow?

---

<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:** [March 24, 2023, 9:16am UTC](https://community.homey.app/t/calculate-date-of-tomorrow/16339/27 "2023-03-24T09:16:01Z")

</div>

> [@Rrrr](#):
>
> Can you calculate date of tomorrow?

Well, yeah, but since date in this flowcard is just an argument (not coding), you will need the “Execute BLL Expression (as Tag)” card (or you would first need to set the date in another card).  
Then place this in the expression:

```auto
date('dddd', new Date(new Date().setDate(new Date().getDate()+1)))

```

That’s it.

What you also could do, is create a function in the BLL App Settings called f.i. addDays, with this in it’s body:

```auto
function (days) {
  let d = new Date();
  return new Date(d.setDate(d.getDate()+days));
}

```

then write this in the Expressioncard:

```auto
date('dddd', addDays(1))

```

Thus, what you have now is:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/0/6068c9c5fcb295cad1d5a00df10f23c9856d7391.jpeg)

and

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

Or, if you want know the day after tomorrow:

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

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [March 24, 2023, 12:41pm UTC](https://community.homey.app/t/calculate-date-of-tomorrow/16339/28 "2023-03-24T12:41:30Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> `date('dddd', addDays(1))`

@Arie_J_Godschalk 💓  
Thank you for your complete answer and the options. Amazing to see how powerful BLL can be.

---

<div class="post-metadata">

**Author:** ![Marcel\_Ubels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_ubels/32/18860_2.png) [@Marcel\_Ubels](https://community.homey.app/u/Marcel_Ubels)\
**Post date:** [March 24, 2023, 1:16pm UTC](https://community.homey.app/t/calculate-date-of-tomorrow/16339/29 "2023-03-24T13:16:33Z")

</div>

And the developer

---

<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:** [March 24, 2023, 2:13pm UTC](https://community.homey.app/t/calculate-date-of-tomorrow/16339/30 "2023-03-24T14:13:57Z")

</div>

Thanks!

And please note, all those codings can be used in any flowcard that supports bll coding, if you place it within `{[]}`  
So, this coding can f.i. be used directly within a Google Service Speak flowcard, without the need for a ExpressionAsTag card.

[Previous page](https://community.homey.app/t/calculate-date-of-tomorrow/16339.md?page=1)
