KB Article #186220

How to change the default dateTime format for the purge command filter in InterPlay

Problem

When running the purge command in InterPlay/extra/Tools/startConsole with a filter on a date in the French format dd/mm/yyyy, e.g.:

./startConsole.sh purge -e "LIFECYCLE_STATUS=\"3\" and CREATION_DATE<\"22/03/2024 11:45:08\""

The command fails with the following error:

ERROR main com.axway.interplay.tools.cli.cmd.CommandTool - Cannot execute command purge
com.axway.interplay.tools.cli.exception.InterPlayToolsException: HTTP status code: 500. Message: Parsing of date '13/02/2024 11:45:08' using format 'MM/dd/yyyy HH:mm:ss' has failed.
 at com.axway.interplay.tools.cli.cmd.purge.PurgeCollectionsService.purge(PurgeCollectionsService.java:60) ~[iplaycli.jar:]
 at com.axway.interplay.tools.cli.cmd.purge.PurgeCollectionsCommand.run(PurgeCollectionsCommand.java:55) ~[iplaycli.jar:]
 at com.axway.interplay.tools.cli.cmd.CommandTool.executeCommand(CommandTool.java:97) ~[iplaycli.jar:]
 at com.axway.interplay.tools.cli.cmd.CommandTool.executeSingleCommand(CommandTool.java:54) ~[iplaycli.jar:]
 at com.axway.interplay.tools.cli.app.IPlayCli.main(IPlayCli.java:74) ~[iplaycli.jar:]
Caused by: com.axway.interplay.tools.cli.exception.InterPlayToolsException: HTTP status code: 500. Message: Parsing of date '13/02/2024 11:45:08' using format 'MM/dd/yyyy HH:mm:ss' has failed.
 at com.axway.interplay.tools.cli.services.RestClientService.callRest(RestClientService.java:206) ~[iplaycli.jar:]
 at com.axway.interplay.tools.cli.services.RestClientService.doDelete(RestClientService.java:153) ~[iplaycli.jar:]
 at com.axway.interplay.tools.cli.cmd.purge.PurgeCollectionsService.purge(PurgeCollectionsService.java:50) ~[iplaycli.jar:]

This happens because the purge command calls the server via REST.

The server tries to parse the date with the format defined in the english dictionary (the ip.uiDatetimeFormat.Java key).

By default this is the value in the english interplay dictionary:

ip.uiDatetimeFormat.Java=MM/dd/yyyy HH:mm:ss



Resolution

Add a new line in the "interplay" dictionary in Studio/Designer with the desired format, then deploy to the "admin" application, e.g.:

ip.uiDatetimeFormat.Java=dd/mm/yyyy HH:mm:ss