কম্পিউটার টিউটোরিয়াল

জাভাস্ক্রিপ্টে ডেট থেকে সেকেন্ড/মিলিসেকেন্ড সরিয়ে ISO স্ট্রিং বানানো

setSeconds(0,0) দিয়ে সেকেন্ড ও মিলিসেকেন্ড শূন্য করে toISOString() দিয়ে ISO ফরম্যাটে রূপান্তর করুন।

উদাহরণ

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
  1. জাভাস্ক্রিপ্টে স্ট্রিং রিপিট করা

  2. How to convert ISO 8601 string to Date/time object in Android?

  3. জাভাতে মিলিসেকেন্ড থেকে ডেট ও টাইম ফরম্যাট করার পদ্ধতি

  4. জাভাতে String কে Date-এ রূপান্তর করা