当前位置:网站首页>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 :
边栏推荐
- 连接ftp服务器教程
- Pit avoidance: description of null values in in and not in SQL
- 【数字IC验证快速入门】29、SystemVerilog项目实践之AHB-SRAMC(9)(AHB-SRAMC SVTB Overview)
- Webcodecs parameter settings -avc1.42e01e meaning
- Keil5 does not support online simulation of STM32 F0 series
- 简述keepalived工作原理
- Use of SVN
- 避坑:Sql中 in 和not in中有null值的情况说明
- Cut ffmpeg as needed, and use emscripten to compile and run
- 大表delete删数据导致数据库异常解决
猜你喜欢
![[quick start of Digital IC Verification] 19. Basic grammar of SystemVerilog learning 6 (thread internal communication... Including practical exercises)](/img/a3/7f08f189c608d6086b368dfa3831f7.png)
[quick start of Digital IC Verification] 19. Basic grammar of SystemVerilog learning 6 (thread internal communication... Including practical exercises)
![[quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)](/img/78/29eb8581e9a8fb4c6c7e1e35ad7adc.png)
[quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)

15. Using the text editing tool VIM

Starting from 1.5, build a microservice framework link tracking traceid

【数字IC验证快速入门】20、SystemVerilog学习之基本语法7(覆盖率驱动...内含实践练习)

TypeScript 发布 4.8 beta 版本

Monthly observation of internet medical field in May 2022

微信小程序 01

【数据挖掘】视觉模式挖掘:Hog特征+余弦相似度/k-means聚类

【兰州大学】考研初试复试资料分享
随机推荐
Connecting FTP server tutorial
LeetCode3_ Longest substring without duplicate characters
The "go to definition" in VS2010 does not respond or prompts the solution of "symbol not found"
Basic knowledge sorting of mongodb database
[server data recovery] a case of RAID data recovery of a brand StorageWorks server
Keil5 does not support online simulation of STM32 F0 series
【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
LeetCode1_ Sum of two numbers
全日制研究生和非全日制研究生的区别!
15. Using the text editing tool VIM
Cocos uses custom material to display problems
HW primary flow monitoring, what should we do
银行需要搭建智能客服模块的中台能力,驱动全场景智能客服务升级
postman生成时间戳,未来时间戳
Jacobo code coverage
大表delete删数据导致数据库异常解决
The rebound problem of using Scrollview in cocos Creator
【数字IC验证快速入门】22、SystemVerilog项目实践之AHB-SRAMC(2)(AMBA总线介绍)
After UE4 is packaged, mesh has no material problem
简述keepalived工作原理








