Skip to content

Instantly share code, notes, and snippets.

View dymx101's full-sized avatar
🎯
Focusing

Yiming Dong dymx101

🎯
Focusing
View GitHub Profile
@dymx101
dymx101 / crypt.sh
Created November 21, 2019 06:33 — forked from soygul/crypt.sh
Encrypt/Decrypt Files Using OpenSSL
# encrypt
openssl enc -in test.txt -aes-256-cbc -pass pass:mypass -out test.txt.enc
# decrypt
openssl enc -in test.txt.enc -d -aes-256-cbc -pass pass:mypass -out test.txt
# valid password sources (as of OpenSSL 1.1.1, see 'man openssl' for more recent info):
# -pass pass:mypass
# -pass env:somevar
# -pass file:somepathname

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:

  1. In the Builder, while editing a request, click the "Pre-request Script" heading below the URL field.

  2. In the editor field that appears, enter this single line of JavaScript:

    postman.setGlobalVariable('timestampUtcIso8601', (new Date()).toISOString());