# Issue with toISOString()

**URL:** <https://forum.kirupa.com/t/issue-with-toisostring/639343>\
**Category:** Uncategorized\
**Created:** [January 30, 2019, 3:43am UTC](https://forum.kirupa.com/t/issue-with-toisostring/639343 "2019-01-30T03:43:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sukhwinder\_Saini](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sukhwinder\_Saini](https://forum.kirupa.com/u/Sukhwinder_Saini)\
**Post date:** [January 30, 2019, 3:43am UTC](https://forum.kirupa.com/t/issue-with-toisostring/639343/1 "2019-01-30T03:43:59Z")

</div>

Hi i am trying to get tomorrow’s date and i am able to get it in default format  
but i need in ISO so i use this function toISOString  
This function is returning me day after tomorrow date  
var tomorrow = new Date();  
tomorrow.setDate(tomorrow.getDate() + 1);  
console.log(tomorrow.toISOString());

Any suggestion how do i fix it?

---

<div class="post-metadata">

**Author:** ![gNeandr](https://avatars.discourse-cdn.com/v4/letter/g/bcef8e/32.png) [@gNeandr](https://forum.kirupa.com/u/gNeandr)\
**Post date:** [February 2, 2019, 10:22pm UTC](https://forum.kirupa.com/t/issue-with-toisostring/639343/2 "2019-02-02T22:22:53Z")

</div>

Don’t get the problem?!  
With tomorrow.setDate(tomorrow.getDate() + 1);  
you get 1549232287858 and that can be used for a new Date(). Typing on the console new Date(1549232287858) will get Date 2019-02-03T22:18:07.858Z and  
that’s the same as:  
(new Date(1549232287858)).toISOString()  
???
