The problem was found during the test today. When the month in the database is 09, the problem occurs. After converting it with parseInt, it will become 0. I am puzzled. After a long test, I did not find any problems in my code. I searched google to find out that was the case.
For parseInt ("01") to parseInt ("07"); parseInt ("10") to later, you can get the correct result, but if it is parseInt ("08 ") or parseInt ("09"), the return value is 0. First, check the parseInt Syntax: parseInt (string, radix ); if the following parameters are not written, start with the first one and judge that string is the string to be converted. radix is binary, octal, hexadecimal or decimal. When radix is not specified by default, it is in hexadecimal format when 0x is switched. If 0 is switched and the second digit is not x, it is in octal format, (the error 0 is returned because there cannot be 8 or 9 in octal ). If it starts with 1, it will be in decimal format, so it will be right after 10. Therefore, we should specify the carry-in system in order to avoid errors. If we usually use decimal digits, we will use parseInt ("08", 10 );
Therefore, it is wrong. It is best to add a number after the parseInt function for future use to ensure no errors. Otherwise, the error occurred several hours .!!!!!!!!!!