I am sending a request to server as a date value in following format in Javascript.
new Date(year+"-"+month+"-"+"31").toISOString()
But when I log it in the console like
console.log( new Date(year+"-"+month+"-"+"31").toISOString())
It shows value as
2022-08-30T18:30:00.000Z
This is causing a serious trouble as I can not get records from database of date 31 of "some month" and "some year" as the date 31st is converted to 30 as shown above. How to overcome this problem?