# Positive dates until new year?

**URL:** <https://community.glideapps.com/t/positive-dates-until-new-year/65420>\
**Category:** Ask for Help\
**Created:** [August 26, 2023, 4:35pm UTC](https://community.glideapps.com/t/positive-dates-until-new-year/65420 "2023-08-26T16:35:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maksidaa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maksidaa/32/62648_2.png) [@Maksidaa](https://community.glideapps.com/u/Maksidaa)\
**Post date:** [August 26, 2023, 4:35pm UTC](https://community.glideapps.com/t/positive-dates-until-new-year/65420/1 "2023-08-26T16:35:56Z")

</div>

I’d like to have a date difference calculation that brings the number of days until the next new year (Jan 1). What would be the best way to execute this? I’m not really sure how to find the date difference between now/today and a date with no year element.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [August 26, 2023, 6:50pm UTC](https://community.glideapps.com/t/positive-dates-until-new-year/65420/2 "2023-08-26T18:50:17Z")

</div>

I’m sure that @Jeff_Hager will be able to give you a single math column to do this, but in the meantime here is a 3 column solution:

Start by using a math column to get Jan 1 as an integer in the format YYYYMMDD:

```auto
(Year(Now)+1)*10^4 + 101

```

 ![CleanShot 2023-08-27 at 02.39.22@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/e/0e3800a4d80c8dd6dc9e7deccd5555959909aae0.png)

Convert that to an actual date using a Text to Date column (using your own timezone):

 ![CleanShot 2023-08-27 at 02.39.45@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/0/e0bb1946c493bed771860669d156e2df7728a87f.png)

And then use a second math column to subtract the current date:

```auto
Trunc(J1-Now)

```

 ![CleanShot 2023-08-27 at 02.40.03@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/f/1f5d39b35a13594d3e2f654d6fc812627a87f20a.png)

The end result should look like this:

 ![CleanShot 2023-08-27 at 02.39.05@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/2/32d8fe354fec4c3426417823f352f1e8a35fae74.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [August 26, 2023, 7:12pm UTC](https://community.glideapps.com/t/positive-dates-until-new-year/65420/3 "2023-08-26T19:12:12Z")

</div>

Another way to do it would be to cheat and use a single JavaScript column:

```auto
return Math.floor((new Date(new Date().getFullYear() + 1,0,1) - new Date()) / (24*60*60*1000));

```

 ![CleanShot 2023-08-27 at 03.11.27@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/1/81dd7ac29ef183fd8e2f1039765f773881afcef5.png)

---

<div class="post-metadata">

**Author:** ![Maksidaa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maksidaa/32/62648_2.png) [@Maksidaa](https://community.glideapps.com/u/Maksidaa)\
**Post date:** [August 26, 2023, 9:12pm UTC](https://community.glideapps.com/t/positive-dates-until-new-year/65420/4 "2023-08-26T21:12:21Z")

</div>

Thanks! I like the cheat Javascript, but I also like knowing how to do it without Javascript since I don’t understand Javascript.
