title: How do I get current ISO8601 timestamp in Postman Pre-Query Script and Body?
body: <p>Using Postman and the following code in pre-query script</p>
  
  <pre><code>   const moment = require('moment');
     pm.globals.set("timestamp", moment().format("YYYY-MM-DDTHH:MM:SSZ"));
  </code></pre>
  
  <p>I get as a response</p>
  
  <p><em>Request signature is too far in the past and has expired. Timestamp date: 2019-11-30T10:11:10+00:00</em></p>
  
  <p>In body I am using {{timestamp}}.</p>
  
  <p>I need timestamp in ISO8601 format.</p>
  
  <p>If I use</p>
  
  <pre><code>    {{$timestamp}}
  </code></pre>
  
  <p>it returns a Linux date of 1575110444 which is correct today at 10:41</p>