Working with metadata variable and refresh value from a sql connection can be heavy. Thus, if you want to manipulate dates and times, scripting is crafted for it.
Example 1 : get current date and 1 dayimportPackage(java.text);
var now = new Date();
var nowIncrement = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1);
format = new SimpleDateFormat('yyyyMMdd');
println('format = '+format.format(nowIncrement));
Example 2 : get current date time and substract 10 minimportPackage(java.text);
var now = new Date(java.lang.System.currentTimeMillis()-((10*60*1000)));
format = new SimpleDateFormat('yyyyMMdd HH:mm:ss');
println('date -10 min = '+format.format(now));
For more information, consult
simple date format documentation
. Remember : the value returned corresponds to the date and time of the server on which your process has been launched.