# Date difference

**URL:** <https://community.glideapps.com/t/date-difference/80524>\
**Category:** Ask for Help\
**Created:** [March 5, 2025, 9:29pm UTC](https://community.glideapps.com/t/date-difference/80524 "2025-03-05T21:29:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbraunperu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mbraunperu/32/83676_2.png) [@mbraunperu](https://community.glideapps.com/u/mbraunperu)\
**Post date:** [March 5, 2025, 9:29pm UTC](https://community.glideapps.com/t/date-difference/80524/1 "2025-03-05T21:29:31Z")

</div>

Hello all, I have two timestamp columns that show dates in South American format (dd/mm/yyyy). I want to get the difference in days between both. But every column I use (math or experimental date difference) regard the dates as mm/dd/yyyy rendering the wrong answer. Help…

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 6, 2025, 12:44am UTC](https://community.glideapps.com/t/date-difference/80524/2 "2025-03-06T00:44:30Z")

</div>

Are those columns imported to Glide, or entered via Glide?

---

<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:** [March 6, 2025, 1:09am UTC](https://community.glideapps.com/t/date-difference/80524/3 "2025-03-06T01:09:10Z")

</div>

Could you please show a screen shot of the two columns in question, as well as the Math formula you used? I’ve never known a math column to give incorrect results for this.

---

<div class="post-metadata">

**Author:** ![mbraunperu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mbraunperu/32/83676_2.png) [@mbraunperu](https://community.glideapps.com/u/mbraunperu)\
**Post date:** [March 6, 2025, 2:55pm UTC](https://community.glideapps.com/t/date-difference/80524/4 "2025-03-06T14:55:29Z")

</div>

Entered via Glide

---

<div class="post-metadata">

**Author:** ![mbraunperu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mbraunperu/32/83676_2.png) [@mbraunperu](https://community.glideapps.com/u/mbraunperu)\
**Post date:** [March 6, 2025, 3:16pm UTC](https://community.glideapps.com/t/date-difference/80524/5 "2025-03-06T15:16:49Z")

</div>

Hello Darren, the first pic shows a date difference as if the date had a U.S. format (although I just saw that under US format, rows 3 to 5 should be 60 days, not 90. How weird!). The second pic shows how the math column renders “invalid op on date time”. Thanks for your time Darren.

 ![a](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/d/0d90f1b97de59948f3462606571acca1ca21d4c5.jpeg)  
 ![b](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/4/a4a61593c4f4364ed1475a494d248e1c3ef23d34.jpeg)

---

<div class="post-metadata">

**Author:** ![mbraunperu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mbraunperu/32/83676_2.png) [@mbraunperu](https://community.glideapps.com/u/mbraunperu)\
**Post date:** [March 6, 2025, 3:59pm UTC](https://community.glideapps.com/t/date-difference/80524/6 "2025-03-06T15:59:25Z")

</div>

Hello Darren, just in case so I don´t use your time, Thinh has just sent me a solution for the date difference. Thanks anyway!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 6, 2025, 11:54pm UTC](https://community.glideapps.com/t/date-difference/80524/7 "2025-03-06T23:54:23Z")

</div>

So the TRUNC math column solution in the other thread works?

> [@Extracting from an array](https://community.glideapps.com/t/extracting-from-an-array/80500/8):
>
> Ok here’s my proposed solution. From the array, use this to get the array length. Use this to calculate the date difference between the start date and now: TRUNC(N-D) Use this to calculate the index of the “current day”: MAX(MOD(D,C),0) And finally this to get the number of the day via the index.

---

<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:** [March 7, 2025, 12:49am UTC](https://community.glideapps.com/t/date-difference/80524/8 "2025-03-07T00:49:31Z")

</div>

I can’t tell what type of column “Hoy” is, but I can tell that the values in that column are not Dates. They are strings that look like dates. And that is why you get the error in the Math column.

If the only purpose of that “Hoy” column is to return the current date, then you don’t need it. You can simply use the built in `Now` variable directly in your math column, like so:

 ![CleanShot 2025-03-07 at 08.48.34@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/9/5996899888a30e7ebc23da129a52d388430c5bda.png)

---

<div class="post-metadata">

**Author:** ![mbraunperu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mbraunperu/32/83676_2.png) [@mbraunperu](https://community.glideapps.com/u/mbraunperu)\
**Post date:** [March 7, 2025, 2:55am UTC](https://community.glideapps.com/t/date-difference/80524/9 "2025-03-07T02:55:52Z")

</div>

I used ROUND instead of TRUNC but yes, it worked!

---

<div class="post-metadata">

**Author:** ![mbraunperu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mbraunperu/32/83676_2.png) [@mbraunperu](https://community.glideapps.com/u/mbraunperu)\
**Post date:** [March 7, 2025, 2:59am UTC](https://community.glideapps.com/t/date-difference/80524/10 "2025-03-07T02:59:37Z")

</div>

Got it. Thanks Darren!
