Last active
January 16, 2018 11:09
-
-
Save matisnape/16a6cc745f6533b940a046abbb4d7f04 to your computer and use it in GitHub Desktop.
Postman snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// date format 2014-12-21T11:32:26.341Z | |
date = new Date().toISOString(); | |
postman.setEnvironmentVariable("date", date); | |
// timestamp example: 1515684365 | |
let randomized = Math.floor(Date.now() / 1000); | |
postman.setEnvironmentVariable("randomized", randomized); | |
// past date | |
date = new Date(); | |
date.setFullYear(2014); | |
// date format YYYY.MM.DD hh:mm:ss | |
start = new Date().toJSON().split(/[TZ.]/).slice(0, 2).join(' ').replace(/-/g, '.'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment