JavaScript countdown function in NewData (). GetTime () Error resolution in iOS

Source: Internet
Author: User

Find a half-day problem Ah!!!

I used mobiscroll.js this plugin, but iOS phone has been an error!

When the mobile-time conversion to time stamp, encountered a problem, Android phone access, can get time stamp, and thus the correct conversion time, and on iOS lack of normal display, display time:Nan-nan1-nan Invalid Date

New Date (' 2016-07-18 14:58:32 '). GetTime (); You can't get a timestamp on iOS. Show Nan

Then I checked a lot of foreign technical blog, finally found a solution, originally wanted to IOS5 Safari can correctly parse the new date () so must write new date (' 2013/10/21 ');

Finally, the code is modified according to the data in the project: new Date("2010-03-15 10:30:00".replace(/-/g,‘/‘)).getTime();终于解决了问题!!!(真是吓死,还以为要任务延期了,还好解决了)

Finally solved this bug.

Paste the reference URL.

Https://www.cnblogs.com/DreamerLeaf/p/6645062.html

JavaScript countdown function in NewData (). GetTime () Error resolution in iOS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.