In the spirit of "there's always another way to do it", I like to use the node-red-contrib-moment
node whenever I need to format time and date strings. Here is an example of how to append the current timestamp formatted as YYYYMMDD to a static filename:
Just put whatever static strings you want inside [...]
square brackets, set the input to be the current timestamp, and use any of moment's many formatting directives. In your case, you would also set the Output to msg.
filename
-- no programming needed!