1new Date('2021-08-28') // Sat Aug 28 2021 18:17:28 GMT+0600 (Bangladesh Standard Time)
2new Date('2021-08-21').toLocaleDateString() // 8/28/2021
1var myDate = new Date("2013/1/16");
2
3var str = "2013/1/16";
4var strToDate = new Date(str);
1Date.parse(dateString)
2//dateString is like 2020-10-10 / 2020-10-10T10:20:20
1var stringval = '01/03/2012';
2var testdate;
3
4try {
5 testdate = $.datepicker.parseDate('mm/dd/yy', stringval);
6 // Notice 'yy' indicates a 4-digit year value
7} catch (e)
8{
9 alert(stringval + ' is not valid. Format must be MM/DD/YYYY ' +
10 'and the date value must be valid for the calendar.';
11}