🆕 Comparing Dates

Glide can’t do date math yet. We’re thinking about this, because we want to get it right.

10 Likes

oh so it worked in my case by pure magic ? :grin: :mage:

@Thibault_Milan what are you getting for a result when your dates cross different months?

By coincidence :wink:

Something I need to check …
:laughing: ok so my date is today 2020-07-09 and 2020-07-10 … which I subtract. Which end in (2020 - 7 - 9 ) - (2020 - 7 - 10) = 1. Coincidence, those two dates should also return 1.

But if my booking date is 2020-08-01 I got … 82 which I cannot explain :sob:

ok I not gonna use this in my app.

:raised_hands:
Hallelujah!!!

@mark, thank you for taking your time to “get it right”. I’m super impressed with this first step!

:clap:

3 Likes

Ok, that makes more sense. 20200801-20200709 = 92, so it probably something along those lines that are happening. It’s just treating the values as numbers instead of dates.

3 Likes

Wishing

1 Like

In the interest of asking for a mile now that you’ve given us a foot… can you please add ‘week’, ‘month’, and ‘year;’ to the ‘within’ comparison?

2 Likes

So, probably easy but help needed. I have a timestamp in a column, I want to calculate a true/false result.

If date stamp within 30 days of today = true, else false

Example
Time stamp 01/01/2020 today date 25/01/2020 Result = True
Time Stamp 01/01/2020 today date 15/03/2020 Result = False

Thanks in advance for any help

Add a column to calculate the “30 days before today” mark in Sheets, something like.

={"Compare date";ARRAYFORMULA(IF(A2:A<>"",TODAY()-30,""))}

Then do the comparison in the Editor.

1 Like

@ThinhDinh Thank you :slight_smile:

1 Like

This is very helpful thanks.
Would anybody now if it is possible in Glide to calculate the number of days between 2 dates ?
I can do it in Google sheet with DATEIF. Is there anything similar in Glide. I tried with Math but does not work. Any suggestions ?

There is no date calculation at this time.

No bother, I have already done so much thanks to Glide that I agree to do things manually.
Cheers Gliders

1 Like

The date is “today” is calculated on the basis of which time zone? I have my app which has users from various time zones and I assumed it works on the device’s current timezone but I think I am getting errors there.
Does this work on a fixed timezone?

Seems helpful but beginners, like me, need tutorials :sweat_smile:

I would have to assume that it’s the device time and most conditions are determined on the device itself. What kind of errors are you getting?

Good :+1:

I have a column that says present or past based on if date for a form submission is “within today” or not.
These forms are filled by people around the world and the Present/Past value change on basis of a fixed timezone I think. So sometimes for a user on another side of the world the date of the form submission and current date is the same in their timezone but it still shows Past and not Present.