Convert text to date/datetime

Certified Associate Developer

Is there a function or rule to convert a piece of text to date or datetime? For e.g. '2017-01-07 19:09:29'. Essentially, I'm looking for the opposite of fn!text which will accept a piece of text and format as input.

OriginalPostID-212479

OriginalPostID-212479

  Discussion posts and replies are publicly visible

Parents
  • Hello Vishal,
    You can save the below expression in a rule and then convert the text to date time value:

    =userdatetime(tointeger(left(ri!txtDate,4)),tointeger(extract(ri!txtDate,"-","-")[1]),tointeger(right(extract(ri!txtDate,"-"," ")[1],2)),tointeger(extract(ri!txtDate," ",":")[1]),tointeger(extract(ri!txtDate,":",":")[1]),tointeger(right(ri!txtDate,2)))
Reply
  • Hello Vishal,
    You can save the below expression in a rule and then convert the text to date time value:

    =userdatetime(tointeger(left(ri!txtDate,4)),tointeger(extract(ri!txtDate,"-","-")[1]),tointeger(right(extract(ri!txtDate,"-"," ")[1],2)),tointeger(extract(ri!txtDate," ",":")[1]),tointeger(extract(ri!txtDate,":",":")[1]),tointeger(right(ri!txtDate,2)))
Children
No Data