Skip to main content
Question

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"

A
Anonymous
December 21, 2025

Answer

Using text() function in the appian we can convert any give date into text format which we want


Code:

text(now(),"mmm-dd-yyyy")

Output:

"Dec-20-2025"(Text)

Explanation

This code converts the current system timestamp into the formatted text string "mmm-dd-yy"

  1. 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)

  1. 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":

  1. mmm: Formats the month as a three-letter abbreviation (e.g., Oct, Dec).
  2. dd: Formats the day as a two-digit number with a leading zero if needed (e.g., 08, 20).
  3. 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:

ri!date : 08/06/2026

Code:

text(ri!date,"mmm-dd-yyyy")

Output:

"Aug-06-2026"(Text)

Image 120














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:

  1. https://appianverse.com/coding/16-generate-weekdays-between-two-dates
  2. https://appianverse.com/coding/15-generate-last-n-years
  3. https://appianverse.com/coding/20-find-the-first-monday-of-every-month
JuniorExpressions#coding