Convert text of type "11 May 2021 07:08:12 GMT" to datetime

Hi Team,

I have a csv in which I am receiving "11 May 2021 07:08:12 GMT" as text in one of the columns, Is there anyway to cast  to Appian datetime type

Regards

Bihitak

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    As mike mentioned you can do this using combination of Appian Functions. You can try this logic it might work for your scenario. This is just a reference you may need to tweak based on your requirement

    a!localVariables(
      local!dateTextValue: "11 May 2021 07:08:12 GMT",
      local!splitDateTextValues: split("11 May 2021 07:08:12 GMT", " "),
      local!month: displayvalue(
        local!splitDateTextValues[2],
        {"Jan", "Feb", "Mar", "April", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec"},
        {1,2,3,4,5,6,7,8,9,10,11,12},
        ""
      ),
      local!splitTime: split(local!splitDateTextValues[4], ":"),
      local!dateTimeValue: datetime(
        tointeger(local!splitDateTextValues[3]),
        tointeger(local!month),
        tointeger(local!splitDateTextValues[1]),
        tointeger(local!splitTime[1]),
        tointeger(local!splitTime[2]),
        tointeger(local!splitTime[3]),
      ),
      local!dateTimeValue
    )

Reply Children
No Data