title: How to add timestamp in Postman request?
body: <p>I want to add two timestamps to a post request in Postman. The first is for Local-time and the second for GMT time. Both should be formatted as <code>YYYYMMDDhhmmss</code>.</p>
  
  <p>The following script displays the date and time as "2017-06-28T08:51:29", but I want the date in simple numbers.</p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>postman.setGlobalVariable('timestampUtcIso8601', (new Date()).toISOString());
  </code></pre>
  
  <p>I tried formatting the date myself, but it didn't work:</p>
  
  <pre class="lang-js prettyprint-override"><code>var time = date.getTime();
  postman.setEnvironmentVariable("currentTime", date);
  </code></pre>
  
  <p>How can I get the date for local and GMT in a <code>YYYYMMDDhhmmss</code> format? Does Postman have built-in functionality for formatting the time and date?</p>