I am using the following function for formatting DateTime
FormatDateTime(UniversalIndexingPage.DateOfDocument, "DD-MON-YY", "", "")
However i am getting the following error in the log
|10.67.60.74 - Cannot create format "DD-MON-YY"
java.lang.IllegalArgumentException: Illegal pattern character 'O'
at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:768)
at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:575)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:500)
at com.pega.ibm.icu.impl.pega.LocaleElements.getSimpleDateFormat(LocaleElements.java:975)
at com.pega.ibm.icu.text.SimpleDateFormat.<init>(SimpleDateFormat.java:93)
at com.pega.pegarules.pub.util.PRDateFormat.createRealFormat(PRDateFormat.java:1544)
at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
Please help!
For 3-character months, try the pattern "dd-MMM-yy" instead of "DD-MON-yy".
See This doc for the patterns: http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
Capital 'D' is for day in the year (1-365), which I don't believe is what you want.