Getting current timestamp in inline pipeline script using pipeline plugin of hudson
<p>I want to get Getting current timestamp in inline pipeline script using pipeline plugin of hudson. For setting up build display name.</p>

<p>Inline groovy script used:</p>

<pre><code>def jobName = env.JOB_NAME + "_" + new Date()
currentBuild.displayName = "$jobName"
node {
   echo "job name $jobName"
}
</code></pre>

<p>Error on console :</p>

<pre><code>org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: 
  Scripts not permitted to use new java.util.Date
</code></pre>