Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Cannot create yyyyMMddTHHmmss.SSS format

SA-90627

Summary



When using the FormatDateTime API to set the DateTime parameter value in an activity with the below format, errors are generated in the logs during the execution of the API.

@(Pega-RULES:DateTime).FormatDateTime(.DateTime1, "yyyyMMddTHHmmss.SSS", "EST", "CANADA")


Error Messages



[WebContainer : 7] (pub.util.PRDateFormat) ERROR - Cannot create format "yyyyMMddTHHmmss.SSS", default format is used
java.lang.IllegalArgumentException: Illegal pattern character 'T'
    at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:837)
    at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:645)
    at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:616)
    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:1838)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:508)
    at com.pega.pegarules.pub.util.PerThreadCache$1.get(PerThreadCache.java:313)
    at com.pega.pegarules.pub.util.PerThreadCache.getFormat(PerThreadCache.java:267)
    at com.pega.pegarules.pub.util.PRDateFormat.format(PRDateFormat.java:501)
    at com.pega.pegarules.exec.internal.util.PRDateTimeUtilsImpl.formatDateTime(PRDateTimeUtilsImpl.java:679)
    at com.pegarules.generated.FormatDateTime_071017_v7CuBlyVOsNOstghDIb1pw.FormatDateTime07_10_17(FormatDateTime_071017_v7CuBlyVOsNOstghDIb1pw.java:129)
    at com.pegarules.generated.FormatDateTime_071017_v7CuBlyVOsNOstghDIb1pw.invoke(FormatDateTime_071017_v7CuBlyVOsNOstghDIb1pw.java:76)
    at com.pega.pegarules.generation.internal.library.LibraryRuntime.resolveAndinvokeFunctionViaReflection(LibraryRuntime.java:133)



Steps to Reproduce

  1. Create an activity.
  2. Set the DateTime parameter value to use the FormatDateTime API.
  3. Run the activity.


Root Cause



T and dot (that is, '.') are the Constants in the format, and the last argument is not the country.


Resolution



Perform the following local-change:
  1. Escape the Constants with a single queue.
  2. Provide the locale value to the last argument as below,

    @(Pega-RULES:DateTime).FormatDateTime(.DateTime1, "yyyyMMdd'T'HHmmss'.'SSS", "EST", "en_CA")

Published March 28, 2020 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us