Skip to main content
March 25, 2022
Question

Convert date format in plain text "APR 1, 2021" to "YYYY-MM-DD" ?

  • March 25, 2022
  • 3 replies
  • 0 views

Is there is any prebuilt function in Appian to Convert date format in plain text  "APR 1, 2021" to "YYYY-MM-DD" or can we write a custom function to achieve this ?

3 replies

mikes0011
Brainy
March 25, 2022

If you're trying to convert a plaintext date like "APR 1, 2021" into an Appian "Date" type object, you'll probably need to concoct something yourself (though if you spend a few minutes searching old posts here you'll probably find code pre-written for you).  To convert a Date object to "yyyy-mm-dd" format, you can simply use the "text()" function, like "text(local!date, "yyyy-mm-dd")".

The Expression Guru
sunilnaikb0002
March 26, 2022

You need to cast it from Date Type to Text. There are different ways to perform casting.
https://docs.appian.com/suite/help/22.1/Casting.html please find here.

March 26, 2022

please go with >> datetext(now(), "yyyy/MM/dd"). this will help i think. Just replace now with whatever and however you want