I want to display only currentdate’s data.
And i want to compare it against a field which is a timestamp.
So i need to take start of current date i.e current date at 00:00:00 hrs sec
For eg. if current date is 15 Nov 2024. I want the output to be -
2024-11-15 00:00:00
I can’t use timestamp below code here, as it will give current timestamp.
I need the timestamp from the start of the date. (2024-11-15 00:00:00 )
I have this code:
const moment = require(‘moment’);
const today = moment();
var todayDate = today.format(‘YYYYMMDD’); let todayDate = moment(todayDate).unix();
pm.globals.set(“todayDate”, todayDate);
This gives me current timestamp.
Can somebody help me here
let c = new Date(); // take the current date/time
c.setHours(0);
c.setMinutes(0);
c.setSeconds(0);
const moment = require("moment");
var todayDate = moment(c).format("YYYY-MM-DD HH:mm:ss");
console.log(todayDate); // "2024-11-15 00:00:00"
Another question.
I was writing a python code to call this api.
I haven’t written a python code with such pre-request script before.
Can you help me how do we pass this code as a value in python code?
What are the libraries used?