KB Article #72746
Expression for renaming the file with a time stamp
What expression can be used to rename a file with the timestamp appended?
Resolution
In order to rename a file test.txt to test_TIMESTAMP.txt, use the following expression:
${basename(stenv.fulltarget)}_${date('yyyyddMMHHmmss')}${extension(stenv.fulltarget)}
This will produce a file named test_20160909143523.txt.
The function date('yyyyddMMHHmmss') returns the time stamp, formatted in the format passed to the function (yyyyddMMHHmmss in this example). The format can be changed according to the notation of the Java Simple Date Format.