Skip to main content
June 22, 2023
Solved

string to date convert

  • June 22, 2023
  • 2 replies
  • 0 views

Hi All,

Can anyone help me convert this string into date format so that I can inject into data base

"20171222"

string format is "yyyyMMdd" I need to convert to date format yyyy-MM-dd so that it can be added to database

    Best answer by mathieud0001

    a!localVariables(
      local!textDate: "20171222",
      date(
        mid(local!textDate, 1, 4),
        mid(local!textDate, 5, 2),
        mid(local!textDate, 7, 2)
      )
    )

    2 replies

    mathieud0001
    June 22, 2023

    a!localVariables(
      local!textDate: "20171222",
      date(
        mid(local!textDate, 1, 4),
        mid(local!textDate, 5, 2),
        mid(local!textDate, 7, 2)
      )
    )

    June 22, 2023

    Thanks Mathieu , really helpful