Format Date Values Using a Formatter

This example shows how you can use Groovy to format a date value.

def dateVal = currentDate
def locale = adf.context.getLocale(); 
 
//To format a date value dateVal to display the day of the week, month name, the day, and the year, you can do:
Date dv1 = dateVal as Date
def fmt1 = new Formatter(locale)
def ret1 = (dv1 != null) ? fmt1.format('%tA, %tB %te, %tY',dv1,dv1,dv1,dv1) : null