# How to calculate days between two dates

**URL:** <https://community.glideapps.com/t/how-to-calculate-days-between-two-dates/61004>\
**Category:** Ask for Help\
**Created:** [April 26, 2023, 9:28am UTC](https://community.glideapps.com/t/how-to-calculate-days-between-two-dates/61004 "2023-04-26T09:28:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![KPT](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@KPT](https://community.glideapps.com/u/KPT)\
**Post date:** [April 26, 2023, 9:28am UTC](https://community.glideapps.com/t/how-to-calculate-days-between-two-dates/61004/1 "2023-04-26T09:28:27Z")

</div>

I though this was simple and I’m pretty sure I’ve done it before. Calculating the days between now and the date of record creation.  
But no matter what I do it end up giving me 0, But I’m expecting a 1 as the log date was yesterday.

I have the following:

 ![Screenshot 2023-04-26 at 10.22.58](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/8/185289b391ae7d309ad79954863a9c692856a2f1.png)

I’ve tried to put the Truncation in caps none caps. But still don’t work.  
Am I doing something completely wrong?

---

<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:** [April 26, 2023, 9:37am UTC](https://community.glideapps.com/t/how-to-calculate-days-between-two-dates/61004/2 "2023-04-26T09:37:19Z")

</div>

If it’s less than 1 day (ie. less than 24 hours), `trunc` will round down to zero.  
Try using `Round(Now - Date)`

Or if you wanted it to always round up, you could use `Ceiling(Now - Date)`

---

<div class="post-metadata">

**Author:** ![KPT](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@KPT](https://community.glideapps.com/u/KPT)\
**Post date:** [April 26, 2023, 10:22am UTC](https://community.glideapps.com/t/how-to-calculate-days-between-two-dates/61004/3 "2023-04-26T10:22:42Z")

</div>

Thanks @Darren_Murphy, Round did the trick.  
Ceiling gave me 1 but for logs created today would also gie me one.

It’s basically needed to format dates into today, yesterday etc… but I think round works

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [April 27, 2023, 10:23am UTC](https://community.glideapps.com/t/how-to-calculate-days-between-two-dates/61004/4 "2023-04-27T10:23:04Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
