Text to date conversion

Certified Senior Developer

How do I convert the   "Thu, 10 Nov, 2022"   this text to date?

I am getting this data from IDP in text format.

  Discussion posts and replies are publicly visible

Parents
  • Hi Vijay Kumar, Please look at this code. Hope it will be helpful if the input is in the mentioned format as above.

    a!localVariables(
      local!months: {
        "Jan",
        "Feb",
        "Mar",
        "APR",
        "May",
        "Jun",
        "Jul",
        "Aug",
        "Sep",
        "Oct",
        "Nov",
        "Dec"
      },
      local!splitString: ldrop(
        a!forEach(
          items: split(ri!input, " "),
          expression: substitute(fv!item, ",", "")
        ),
        1
      ),
      date(
        tointeger(local!splitString[3]),
        wherecontains(local!splitString[2], local!months),
        tointeger(local!splitString[1])
      )
    )

Reply
  • Hi Vijay Kumar, Please look at this code. Hope it will be helpful if the input is in the mentioned format as above.

    a!localVariables(
      local!months: {
        "Jan",
        "Feb",
        "Mar",
        "APR",
        "May",
        "Jun",
        "Jul",
        "Aug",
        "Sep",
        "Oct",
        "Nov",
        "Dec"
      },
      local!splitString: ldrop(
        a!forEach(
          items: split(ri!input, " "),
          expression: substitute(fv!item, ",", "")
        ),
        1
      ),
      date(
        tointeger(local!splitString[3]),
        wherecontains(local!splitString[2], local!months),
        tointeger(local!splitString[1])
      )
    )

Children