Hi,
as far as I know there are many options (just google and you'll find many forum messages) varying from
- using java.text.SimpleDateFormat("yyyyMMdd")
to
- using a select step for changing metadata datatype with a specific format
Given your example you should be aware that the JS step uses Rhino (somebody please correct me if I'm wrong) which might have a different behaviour from JS6. For example I remember the Date constructor is locale dependent and -in short- not recommended.
I hope you can find a solution in the two examples proposed, but, if you are in a more complex scenario you can even import a js library like Moment.js for special calculations. This once happened to me
My regards
Virgilio