# Date formula not working!

**URL:** <https://community.glideapps.com/t/date-formula-not-working/71567>\
**Category:** Ask for Help\
**Created:** [March 10, 2024, 5:30pm UTC](https://community.glideapps.com/t/date-formula-not-working/71567 "2024-03-10T17:30:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Gabler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david_gabler/32/44332_2.png) [@David\_Gabler](https://community.glideapps.com/u/David_Gabler)\
**Post date:** [March 10, 2024, 5:30pm UTC](https://community.glideapps.com/t/date-formula-not-working/71567/1 "2024-03-10T17:30:22Z")

</div>

A formula for “today – date only” that I was given years ago does not work today.

It should be 3/10/2024. Why is it broken?

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

---

<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:** [March 10, 2024, 5:57pm UTC](https://community.glideapps.com/t/date-formula-not-working/71567/2 "2024-03-10T17:57:09Z")

</div>

The time changed last night (Daylight Savings). It’s calculating the number of hours from midnight. One hour was skipped at 2am. The math is accurate and calculates to 11pm on the previous day due to the skipped hour.

---

<div class="post-metadata">

**Author:** ![David\_Gabler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david_gabler/32/44332_2.png) [@David\_Gabler](https://community.glideapps.com/u/David_Gabler)\
**Post date:** [March 10, 2024, 6:01pm UTC](https://community.glideapps.com/t/date-formula-not-working/71567/3 "2024-03-10T18:01:36Z")

</div>

Is there a solution?

---

<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:** [March 10, 2024, 6:05pm UTC](https://community.glideapps.com/t/date-formula-not-working/71567/4 "2024-03-10T18:05:24Z")

</div>

Come up with some complex math that mathematically performs IF logic…or just don’t try to back date to midnight.

---

<div class="post-metadata">

**Author:** ![David\_Gabler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david_gabler/32/44332_2.png) [@David\_Gabler](https://community.glideapps.com/u/David_Gabler)\
**Post date:** [March 12, 2024, 4:53pm UTC](https://community.glideapps.com/t/date-formula-not-working/71567/5 "2024-03-12T16:53:24Z")

</div>

I’m afraid my math skills are not good enough to even know what part dates back to midnight. As I stated, this solution was given to me.

I was hoping there’d be some native ‘date’ thing that would replace this.

---

<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 12, 2024, 4:57pm UTC](https://community.glideapps.com/t/date-formula-not-working/71567/6 "2024-03-12T16:57:20Z")

</div>

If you just want the current date, you can use the special `Now` value.

What are you actually using it for?

---

<div class="post-metadata">

**Author:** ![David\_Gabler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david_gabler/32/44332_2.png) [@David\_Gabler](https://community.glideapps.com/u/David_Gabler)\
**Post date:** [March 12, 2024, 5:10pm UTC](https://community.glideapps.com/t/date-formula-not-working/71567/7 "2024-03-12T17:10:57Z")

</div>

If I recall, it was important that the times all matched in value in order for other logic to work correctly (date matches, etc.) Even though I set it to “date only”, Glide stores the actual time in the value, and it was causing matches to not work correctly.

I’ve since moved this logic into other Apps, however. The App I’m working on currently is where the problem is rearing it’s ugly head that the actual date being calculated is no longer correct. It actually does start with the “NOW” value for the calculation.

---

<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 12, 2024, 5:21pm UTC](https://community.glideapps.com/t/date-formula-not-working/71567/8 "2024-03-12T17:21:38Z")

</div>

Okay, so what I normally do when I want to compare dates and make sure the time doesn’t get in the way is first convert the date/time values to integers in YYYYMMDD format.

The following formula does that:

```auto
Year(Date) * 10^4
+ Month(Date) * 10^2
+ Day(Date)

```

---

<div class="post-metadata">

**Author:** ![David\_Gabler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david_gabler/32/44332_2.png) [@David\_Gabler](https://community.glideapps.com/u/David_Gabler)\
**Post date:** [March 12, 2024, 6:02pm UTC](https://community.glideapps.com/t/date-formula-not-working/71567/9 "2024-03-12T18:02:15Z")

</div>

Thank you.

---

<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:** [March 19, 2024, 6:02pm UTC](https://community.glideapps.com/t/date-formula-not-working/71567/10 "2024-03-19T18:02:52Z")

</div>

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