当前位置:网站首页>Postman generate timestamp, future timestamp
Postman generate timestamp, future timestamp
2022-07-07 15:46:00 【Test super brother】
Support acquisition : Current timestamp 、 Future timestamp 、 Specify time stamp 、 The current date is 、 In the future
- Get the current timestamp
// Get the current timestamp
let timestamp = (new Date()).getTime().toString();
// Console output timestamp
console.log(" Current timestamp :",timestamp)
// hold startDate Set timestamp as environment variable
pm.environment.set("startDate", timestamp);
demonstration :
- Specify Date , Generate timestamps
// Set date timestamp
var data_f = new Date(2022,7.05);
var appoint = data_f .getTime()
console.log(" Specify a date timestamp :",appoint)
pm.environment.set("expiration", appoint);
demonstration :
- Get future timestamp
// Get the current time in the format of year month day
var date = new Date();
// Set the current time to 3 Days later
date.setDate(date.getDate() + 3)
// Check whether the modification is successful
console.log(date)
// Put the revised time , Convert to timestamp
var toTimes = date.getTime()
// Check the timestamps
console.log(toTimes)
// hold toTimes Set to expirationDate environment variable
pm.environment.set("expirationDate", toTimes);
demonstration :
- Get future timestamp And “ Sand carving method ”:

// Future timestamp
let appoint = new Date().getTime();
// Three days total milliseconds =259200000
appoint=appoint+259200000
console.log('72 Time stamp of ', appoint)
pm.environment.set("expirationDate", appoint);
demonstration :
- obtain : Specific date (YYYYMMDDHHmmss)
// Quoting third-party libraries :moment Equate to import moment from 'moment'
var moment = require('moment');
// call moment() Method to get the current time , And format , With variable currentRime receive
var currentTime = moment().format(" YYYYMMDDHHmmss");
// Print the value of the current time to the console
console.log(" The current time is :", currentTime);
// Put it in the environment variable
pm.environment.set("beginTime", currentTime);
demonstration :
- Get future time :10 Minutes later
// Quoting third-party libraries :moment Equate to import moment from 'moment'
var moment = require('moment');
// Future time , such as : At the present time 10 Minutes later , Accurate to seconds
var beginTime = moment().add(10,"m").format(" YYYYMMDDHHmmss");
// Starting time , At the present time 1 Hours later, , Accurate to seconds
var endTime = moment().add(1,"H").format(" YYYYMMDDHHmmss");
console.log("10 Time in seconds :", beginTime);
console.log("1 Hours later :", endTime);
demonstration :
- Date format : 2022-07-04T11:27:15
// 72 Hours later
var moment = require('moment');
var YTD = moment().add(72,"H").format(" YYYY-MM-DDTHH:mm:ss");
console.log("72 Mm / DD / yyyy time after :",YTD);
// Set as variable
pm.environment.set("tokenExpirationTime", YTD);
demonstration :
- Generate current time , The type is :“2022-07-01T05:18:17.580Z”
var a = new Date()
console.log(" current time :",a)
demonstration :
- Three days after generation
var a = new Date()
a.setDate(4)
console.log(" Future time :",a)
demonstration :
边栏推荐
- Use cpolar to build a business website (2)
- Do you know the relationship between the most important indicators of two strong wind control and the quality of the customer base
- Async and await
- Getting started with webgl (2)
- Unity之ASE实现全屏风沙效果
- Syntax of generator function (state machine)
- 【數字IC驗證快速入門】26、SystemVerilog項目實踐之AHB-SRAMC(6)(APB協議基本要點)
- The download button and debug button in keil are grayed out
- Ida Pro reverse tool finds the IP and port of the socket server
- [Data Mining] Visual Pattern Mining: Hog Feature + cosinus Similarity / K - means Clustering
猜你喜欢

After UE4 is packaged, mesh has no material problem
![[Lanzhou University] information sharing of postgraduate entrance examination and re examination](/img/06/df5a64441814c9ecfa2f039318496e.jpg)
[Lanzhou University] information sharing of postgraduate entrance examination and re examination

简述keepalived工作原理

2022全开源企业发卡网修复短网址等BUG_2022企业级多商户发卡平台源码

【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)

2. 堆排序『较难理解的排序』

Vertex shader to slice shader procedure, varying variable

Yunxiaoduo software internal test distribution test platform description document

Keil5 does not support online simulation of STM32 F0 series

如何在opensea批量发布NFT(Rinkeby测试网)
随机推荐
Actually changed from 408 to self proposition! 211 North China Electric Power University (Beijing)
The "go to definition" in VS2010 does not respond or prompts the solution of "symbol not found"
2022 all open source enterprise card issuing network repair short website and other bugs_ 2022 enterprise level multi merchant card issuing platform source code
【数字IC验证快速入门】29、SystemVerilog项目实践之AHB-SRAMC(9)(AHB-SRAMC SVTB Overview)
Webcodecs parameter settings -avc1.42e01e meaning
[original] all management without assessment is nonsense!
知否|两大风控最重要指标与客群好坏的关系分析
Nacos conformance protocol cp/ap/jraft/distro protocol
Stm32f103c8t6 PWM drive steering gear (sg90)
摘抄的只言片语
[follow Jiangke University STM32] stm32f103c8t6_ PWM controlled DC motor_ code
The rebound problem of using Scrollview in cocos Creator
leetcode 241. Different ways to add parentheses design priority for operational expressions (medium)
[quick start for Digital IC Validation] 26. Ahb - sramc (6) for system verilog project practice (Basic Points of APB Protocol)
【数字IC验证快速入门】18、SystemVerilog学习之基本语法5(并发线程...内含实践练习)
【原创】一切不谈考核的管理都是扯淡!
Excerpted words
The significance of XOR in embedded C language
【跟着江科大学Stm32】STM32F103C8T6_PWM控制直流电机_代码
【深度学习】语义分割实验:Unet网络/MSRC2数据集








