# Today and 14 days ahead

**URL:** <https://community.glideapps.com/t/today-and-14-days-ahead/57669>\
**Category:** Ask for Help\
**Created:** [February 8, 2023, 6:40pm UTC](https://community.glideapps.com/t/today-and-14-days-ahead/57669 "2023-02-08T18:40:00Z")\
**Posts on this page:** 5\
**Page:** 2

<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:** [February 9, 2023, 11:55pm UTC](https://community.glideapps.com/t/today-and-14-days-ahead/57669/22 "2023-02-09T23:55:57Z")

</div>

> [@Krivo](#):
>
> @Darren_Murphy i wonder if you have used this approach when the future 14 days includes a change of month which will happen.

Yes, all the time.  
But, I missed a column in that solution that I gave you - oops 🤦‍♂️

_THIS_ is how I would do it:

- Math column to return todays date
- Math column to add the row index to todays date
- Math column to convert to YYYYMMDD

This approach deals with month/year boundaries just fine.

 ![CleanShot 2023-02-10 at 07.52.04 2@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/d/fdd9ef7a489b50c6242667bcdc3ad5a2cc7fa639.jpeg)

Sorry about that, I’m not sure what I was thinking yesterday 🤪

---

<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:** [February 10, 2023, 12:03am UTC](https://community.glideapps.com/t/today-and-14-days-ahead/57669/23 "2023-02-10T00:03:25Z")

</div>

> [@Krivo](#):
>
> The way template column handles date&time column might just be lucky as it takes away hours, minutes, seconds. I hope it will keep working like that - otherwise I will be in trouble

It should be, but you could potentially come unstuck by device regional date formatting issues, especially if you have Dates saved as text anywhere.

Personally, I think the “convert-to-integer” approach is a more robust approach. I’ve never known that to fail.

(as long as it’s done properly, of course) 😉

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [February 10, 2023, 12:06am UTC](https://community.glideapps.com/t/today-and-14-days-ahead/57669/24 "2023-02-10T00:06:14Z")

</div>

I understand the formula very well. From your explanation, it’s seems TRUNC acts differently when applied to a difference between dates than applied to a date only. Intuitively, since Date is the integer and Time the float (at least this is my understanding), then I would have expected TRUNC(DateTime) to be Date (at midnight).

I will hit the sack, ponder this, and experiment tomorrow morning. Thank you Jeff for your explanations.

Darren, we cross paths, good morning! 🌞

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [February 10, 2023, 12:41am UTC](https://community.glideapps.com/t/today-and-14-days-ahead/57669/25 "2023-02-10T00:41:43Z")

</div>

> [@nathanaelb](#):
>
> Intuitively, since Date is the integer and Time the float (at least this is my understanding), then I would have expected TRUNC(DateTime) to be Date (at midnight).

Yes, that is definitely true, and Trunc(Now) is essentially the date at midnight, but the result for today is `44966` which can be converted back to a normal date in Google, but there is no function in Glide to convert it back to a date. 44966 is the number of days since Dec 30th 1899. That’s not a number that’s useful for me to subtract a few hours.

I guess an easier alternative would be to set the seed date to Dec 30th 1899 at midnight and then change the math column to `seed+TRUNC(now)`. Probably should have thought of that instead. That makes a lot more sense.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/d/8d99e21fd4315668359529bc8ca08c4c6d8329cf.png)

I wish Glide had functions in the math column to convert text to date, similar to Google’s DATE and DATEVALUE functions. Then we wouldn’t need some of these extra columns to make these functions work.

(Sorry guys, I’m living in the past. Feb 9th really is today for me. 😉 )

---

<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:** [February 14, 2023, 5:31pm UTC](https://community.glideapps.com/t/today-and-14-days-ahead/57669/26 "2023-02-14T17:31:01Z")

</div>

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

[Previous page](https://community.glideapps.com/t/today-and-14-days-ahead/57669.md?page=1)
