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?
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?
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.
Is there a solution?
Come up with some complex math that mathematically performs IF logic…or just don’t try to back date to midnight.
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.
If you just want the current date, you can use the special Now
value.
What are you actually using it for?
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.
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:
Year(Date) * 10^4
+ Month(Date) * 10^2
+ Day(Date)
Thank you.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.