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



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(
    at java.text.SimpleDateFormat.initialize(
    at java.text.SimpleDateFormat.<init>(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at com.pega.pegarules.exec.internal.util.PRDateTimeUtilsImpl.formatDateTime(
    at com.pegarules.generated.FormatDateTime_071017_v7CuBlyVOsNOstghDIb1pw.FormatDateTime07_10_17(
    at com.pegarules.generated.FormatDateTime_071017_v7CuBlyVOsNOstghDIb1pw.invoke(
    at com.pega.pegarules.generation.internal.library.LibraryRuntime.resolveAndinvokeFunctionViaReflection(

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.


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