Support Article
Cannot use a DateTime control with non-standard format
SA-52197
Summary
User is trying to create a new Control rule which will display DateTime in a custom Date Time format but encounters error.
Error Messages
Cannot create format "DateTime-DayMonthYear-Custom", default format is used
java.lang.IllegalArgumentException: Illegal pattern character 't'
at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:845)
at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:659)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:585)
at com.pega.ibm.icu.impl.pega.LocaleElements.getSimpleDateFormat(LocaleElements.java:1373)
at com.pega.ibm.icu.text.SimpleDateFormat.<init>(SimpleDateFormat.java:93)
at com.pega.pegarules.pub.util.PRDateFormat.createRealFormat(PRDateFormat.java:1861)
at sun.reflect.GeneratedMethodAccessor95.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.pega.pegarules.pub.util.PerThreadCache$1.get(PerThreadCache.java:313)
at com.pega.pegarules.pub.util.PerThreadCache.getFormat(PerThreadCache.java:220)
at com.pega.pegarules.pub.util.PRDateFormat.format(PRDateFormat.java:503)
at com.pega.pegarules.exec.internal.util.PRDateTimeUtilsImpl.formatDateTime(PRDateTimeUtilsImpl.java:718)
at com.pegarules.generated.pxFormatDateTime_071017_nbON9iBZMLvY_eVJ9sjXBA.pxFormatDateTime07_10_17(pxFormatDateTime_071017_nbON9iBZMLvY_eVJ9sjXBA.java:310)
at com.pegarules.generated.pxFormatDateTime_071017_nbON9iBZMLvY_eVJ9sjXBA.invoke(pxFormatDateTime_071017_nbON9iBZMLvY_eVJ9sjXBA.java:73)
at com.pega.pegarules.generation.internal.library.LibraryRuntime.resolveAndinvokeFunctionViaReflection(LibraryRuntime.java:221)
at com.pega.pegarules.generation.internal.library.LibraryRuntime.invokeLibraryRuntime(LibraryRuntime.java:119)
at com.pega.pegarules.session.internal.mgmt.Executable.invokeLibraryRuntime(Executable.java:9073)
at com.pega.pegarules.priv.generator.LibrarySupport.resolveAndInvokeFunctionViaReflectionWithException(LibrarySupport.java:275)
Steps to Reproduce
1. Try to select one of the Out-of-the-box (OOTB) formats on pxdatetime control.
2. Run preview.
Root Cause
A defect in Pegasystems’ code or rules: UI control not passing the right format to Engine formatter.
Resolution
Apply HFix 41434.
Published April 30, 2018 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.