I wanted to know: How can I get the current timestamp for UTC in ISO 8601 format to appear in the body data of a Postman request?
After reading some of the Postman documentation and online comments, this is the solution (using Postman v5.0.1 for Chrome 58.0.3029.110 on macOS 10.12.5) I used:
-
In the Builder, while editing a request, click the "Pre-request Script" heading below the URL field.
-
In the editor field that appears, enter this single line of JavaScript:
postman.setGlobalVariable('timestampUtcIso8601', (new Date()).toISOString());