Date and time comparison

I am having date and time of submitted form in Date time format.
I want to compare the date and time if it exceeds 1 hr from submission I want to show a proceed button.

How I can give a condition where it is comparing submitted form have completed 1hr 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    a!localVariables(
      /* Date from DB */
      local!dateTime: todatetime("20/11/2023 09:45"),
      /* Extract time */
      local!time: totime(local!dateTime),
      /* Get hour by having difference */
      local!differnce: tointeger(
        index(
          split(totime(now() - local!time), ":"),
          1,
          null()
        )
      ),
      /* Get the required value based on calculation */
      if(local!differnce >= 1, true, false)
    )

    Hi   , you can create a rule which calculates the difference and based on that you can either show or hide buttons.

Reply
  • 0
    Certified Senior Developer

    a!localVariables(
      /* Date from DB */
      local!dateTime: todatetime("20/11/2023 09:45"),
      /* Extract time */
      local!time: totime(local!dateTime),
      /* Get hour by having difference */
      local!differnce: tointeger(
        index(
          split(totime(now() - local!time), ":"),
          1,
          null()
        )
      ),
      /* Get the required value based on calculation */
      if(local!differnce >= 1, true, false)
    )

    Hi   , you can create a rule which calculates the difference and based on that you can either show or hide buttons.

Children
No Data