How will you convert a given date in "MMM-DD-YYYY " string format ? Example : if date is "10/8/2025" convert date into the "Oct-08-2025"
How will you convert a given date in "MMM-DD-YYYY " string format ? Example : if date is "10/8/2025" convert date into the "Oct-08-2025"
Answer
Using text() function in the appian we can convert any give date into text format which we want
Code:
Output:
Explanation
This code converts the current system timestamp into the formatted text string "mmm-dd-yy"
- now() : Returns current date and time in appian based on the server environment
eg: now() output in -> 10/8/2026 11:53 AM EDT(Date and Time with Timezone)
- We can also use today() function to achieve same results
text(today(),"mmm-dd-yyyy") gives the same result output: "Dec-20-2025"(Text)
"mmm-dd-yyyy":
- mmm: Formats the month as a three-letter abbreviation (e.g., Oct, Dec).
- dd: Formats the day as a two-digit number with a leading zero if needed (e.g., 08, 20).
- yyyy: Formats the year as a full four-digit number (e.g., 2025).
If you want to achieve this for given date, just use ri!date as input variable instead of now(). ri!date type can be date / datetime
Input:
Code:
Output:

If you want to achieve a formatted date in multiple places, save this rule as eg: AV_formatDate in the utility folder ( usually every project maintains a folder to hold commonly used functions ) and call the rule in places you want to use it.
Want to practice more coding questions related to dates, visit this coding challenges: