Some iOS models new Date() time NAN

Some iOS models new Date() time NAN

solve code

Insert image description here

is because for some iOS models when new Date(2023-01-01 00:00:00), the time, year, month and day to obtain the timestamp are separated by -, just change the - separation to / separation new Date(2023/01/01 00:00:00)

Guess you like

Origin blog.csdn.net/m0_53562074/article/details/134252272