Date. parse (dateval)
This method is very common. For example, you can use it to verify whether the input date exists. If it is a non-existent date, the return value will be Nan, in addition, it can be used to compare the order of two dates or calculate the number of days for the difference between the two dates.
Today, I encountered a strange problem when I used it to compare the date sequence. It is about the date format. The parse method requires that the short date can use "/" or "-" as the separator, however, the format must be monthly, daily, or yearly. For example, if the format is "7/6/2008" or "7-6-2008", the problem occurs here. When the format "7-6-2008" is used, it can be parsed normally in IE, but in Firefox, the return value is always Nan. First thought it wasCodeIf a problem occurs, check the browser and change the format to "7/6/2008". Then, it can be parsed in IE and ff.