Reputation: 1395
From within a workflow script we are using a tool that puts a timestamp into the path, we therefore need to be able to get the current date and time from within the groovy script.
Is there a step or some compatible Java we can use to do this?
Upvotes: 0
Views: 435
Reputation: 36
import java.text.SimpleDateFormat
{
...
def dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH-mm");
def date = new Date();
println(dateFormat.format(date));
...
}
Upvotes: 1