# Substrat Integer from Date

**URL:** <https://forum.bubble.io/t/substrat-integer-from-date/210700>\
**Category:** Need help\
**Created:** [June 10, 2022, 2:41pm UTC](https://forum.bubble.io/t/substrat-integer-from-date/210700 "2022-06-10T14:41:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![philipp.laengle107](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/philipp.laengle107/32/262608_2.png) [@philipp.laengle107](https://forum.bubble.io/u/philipp.laengle107)\
**Post date:** [June 10, 2022, 2:41pm UTC](https://forum.bubble.io/t/substrat-integer-from-date/210700/1 "2022-06-10T14:41:12Z")

</div>

Hi all,

I ran into a slightly awkward problem and hope that someone can help me.

I would like to show the remaining days of an offer as shown below.

If I deduct the 30 before the dates, bubble doesn’t get that the 30 should be part of the calculation.  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/a/c/ac958d280fa5252503c20b049fc9722439e7ce37.png)

If I deduct the 30 after the dates, bubble understands that it’s part of the calculation. But then the remaining days value is negative. (-29 days remaining for example)  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/2/b/2bea02dc89543cb8b1f5749223c516e9f79d8ce1.png)

Does anyone know how I can either use the 30 in the front (with no JS if possible), or how I can reverse the - to + value in the second example?

Best regards,  
Philipp

---

<div class="post-metadata">

**Author:** ![BrianHenderson](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/brianhenderson/32/231409_2.png) [@BrianHenderson](https://forum.bubble.io/u/BrianHenderson)\
**Post date:** [June 10, 2022, 2:50pm UTC](https://forum.bubble.io/t/substrat-integer-from-date/210700/2 "2022-06-10T14:50:58Z")

</div>

You could multiply by -1 to flip the sign.

---

<div class="post-metadata">

**Author:** ![philipp.laengle107](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/philipp.laengle107/32/262608_2.png) [@philipp.laengle107](https://forum.bubble.io/u/philipp.laengle107)\
**Post date:** [June 10, 2022, 2:55pm UTC](https://forum.bubble.io/t/substrat-integer-from-date/210700/3 "2022-06-10T14:55:46Z")

</div>

I didn’t see the forest due to the trees… You’re absolutely right. Thanks a lot for your quick response to my question! 🙂

---

<div class="post-metadata">

**Author:** ![BrianHenderson](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/brianhenderson/32/231409_2.png) [@BrianHenderson](https://forum.bubble.io/u/BrianHenderson)\
**Post date:** [June 10, 2022, 3:08pm UTC](https://forum.bubble.io/t/substrat-integer-from-date/210700/4 "2022-06-10T15:08:54Z")

</div>

It’s my pleasure! Once upon a time I was stumped by a similar issue and Gaby Román @romanmg kindly spelled out the very obvious solution for me 😅

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [August 19, 2022, 2:41pm UTC](https://forum.bubble.io/t/substrat-integer-from-date/210700/5 "2022-08-19T14:41:28Z")

</div>

Closed on August 19, 2022, 2:41pm UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
