I have this string which I want to create a date from :
Wed Jun 16 2021 00:00:00 GMT+0300 (Israel Daylight Time)
Now when I try to make a new date from it :
const date = new Date('Wed Jun 16 2021 00:00:00 GMT+0300 (Israel Daylight Time)');
And try to output it, it shows :
2021-06-15T21:00:00.000Z
Now, the problem is that it moves the date by one day. I've read few threads that are opened with similar problem to mine saying it is something with the conversion that JSON does and such. I tried multiple things that will show the date correctly ( should be 16 and not 15 ), but without luck.
How do I make a date that is showing the correct date without any conversions ?
new Date().toLocaleString('default',{timeZone:'Asia/Jerusalem', timeZoneName:'long'})produces something like "03/06/2021, 14:58:02 Israel Daylight Time".