I used setTimeInterval to make a countdown function. It was fine when I tested it with developer tools, but I couldn’t count down normally when I debugged it with the ios real machine. Later, I found out that the problem lies inDate.parse
Date.parse(endTime)
If the incoming endTime is 2022-01-12 12:21:09
in the format, ios cannot parse it normally. If you replace -
it with /
, all operating systems can display it normally.
Date.parse(endTime.replace(/-/g, "/"))