On the compatibility of toLocalDateString () methods in IE browsers

for the year, month and day obtained by the toLocalDateString () method, the early morning timestamp of the day is obtained through new Date (). A Invalid Date error occurs in the IE browser, but if you write the same date string directly, you will get a normal timestamp. What is the reason? The code is as follows

   

ask the boss to help with the answer!

Jun.15,2022

the date on the left is timeString , and the date on the right is hand-typed, but it is not equal when all the dates are string .
print out the length of timeString , you will find that the actual length is 15
clipboard.png

15,IE11toLocaleDateString
clipboard.png

under IE11 .

solution: keep only numbers and symbols -/ , and exclude all others
date.toLocaleDateString (). Replace (/ (year | month) / gdepartment'/). Replace ('day','). Replace (/ / [^\ Dmurf /] / gjingjue')

the above recommendation does not use toLocaleDateString or similar api` Because the results returned by different languages are different https://stackoverflow.com/que...
document
https://developer.mozilla.org...

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e98cb9-4ebd4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e98cb9-4ebd4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?