You do know that now has methods like now.getMonth ?
And you can format datetimes like such as now.toString("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
EDIT - the problem with the code you attempting is incorrect use of substring(x,y)
In java, both x and y are position index, not character counts.
So substring(12, 4) is nonsense … “get the characters from position 12 to 4”
You’d want substring(12, 12+4)
import java.text.SimpleDateFormat
import java.util.Date
var SimpleDateFormat sdf = new SimpleDateFormat("yyyy MM dd")
val String strDate = sdf.format(new Date())
sdf = new SimpleDateFormat("HH:mm")
val String strTime = sdf.format(new Date())
executeCommandLine("curl@@https://pvoutput ... ")
executeCommandLine(" this part is just a string ")
executeCommandLine(" this part " + "is still one string" + " made from parts")
var someStuff = "is still one string"
executeCommandLine(" this part " + someStuff + " made from parts")