How to use dateTimeAfter/dateTimeBefore correctly?

How to use dateTimeAfter/dateTimeBefore correctly?

Cheesedz
Shopify Partner
6 0 1

According to docs, dateTimeBefore will return true if the current date and time is before the given date and time, and false otherwise.

but when I try to use other time in my input query for the cart and checkout validation function, one is the start of the day, and one is the end of the day but it returns the same value is true

  shop {
    localTime {
      dateTimeBefore(dateTime: "2024-09-30T23:24:31")
    }
  }

 

Reply 1 (1)
Cheesedz
Shopify Partner
6 0 1

I'm trying to validate the expiration time that I set in Metafield, because we cannot get the current time in function to compare, so I considered using this. Can it help for this case?