Skip to main content
Known Participant
Jun 22, 2023 11:03 AM UTC
Solved

string to date convert

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

    mathieud0001
    Genius
    Jun 22, 2023 11:21 AM UTC

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

    2 replies

    mathieud0001
    Genius
    Jun 22, 2023 11:21 AM UTC

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

    Known Participant
    Jun 22, 2023 11:38 AM UTC

    Thanks Mathieu , really helpful