Skip to main content
New Participant
Mar 25, 2022 8:02 PM UTC
Question

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

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
Mar 25, 2022 8:50 PM UTC

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
Inspiring
Mar 26, 2022 5:29 AM UTC

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.

Participating Frequently
Mar 26, 2022 1:56 PM UTC

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