# 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:** 1\
**Showing post:** 20

<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, 8:56am UTC](https://community.homey.app/t/calculate-date-of-tomorrow/16339/20 "2020-09-19T08:56:19Z")

</div>

i found my own fault, i set setdate with month 9, of course it had to be 8 🙂  
with your correction, i have tested it, and now it works!!!

thank you very much!!  
my whole script is now:

let BLVarName=“DatumVanMorgen”; //the variable for BetterLogic  
let CurrentDate = new Date();  
//CurrentDate = new Date(2020,8,30)  
CurrentDate.setDate(CurrentDate.getDate() + 1);

const TomorrowDate = ‘d-m-Y’  
.replace(‘d’, (‘0’ + CurrentDate.getDate()).toString().slice(-2))  
.replace(‘m’, (‘0’ + (CurrentDate.getMonth() + 1)).toString().slice(-2))  
.replace(‘Y’, CurrentDate.getFullYear());

console.log(TomorrowDate);  
let BLApp = await Homey.apps.getApp({id:“net.i-dev.betterlogic” });  
let result = await BLApp.apiPut("/" + BLVarName + “/” + TomorrowDate);  
return true;

---

_[View the full topic](https://community.homey.app/t/calculate-date-of-tomorrow/16339)._
