उदाहरण
setSeconds(0,0) से सेकंड और मिलीसेकंड शून्य करें, फिर toISOString() से कन्वर्ट करें।
var currentDate = new Date();
console.log("The current date is as follows=" + currentDate);
currentDate.setSeconds(0, 0);
console.log("After removing seconds from date, the new date is as follows=");
console.log(currentDate.toISOString());
प्रोग्राम चलाने के लिए:
node fileName.js
आउटपुट
PS C:\Users\Amit\JavaScript-code> node demo143.js The current date is as follows=Sat Aug 01 2020 18:20:09 GMT+0530 (India Standard Time) After removing seconds from date, the new date is as follows= 2020-08-01T12:50:00.000Z