iOS does not support date formats for 2017-09-09

Source: Internet
Author: User

Today in the project to meet a more wonderful problem, the same code, under the Android machine can be normal display, but to the Apple machine is alive and well display, and finally positioning, the original iOS system does not support the date format 2017-09-08 , and Android support a number of date formats, display is no problem, look at the conversion code below,

//iterate through the JSON array, get each time to compare with the current time, pass me less than 10 minutes, show is dropping        if(NULL! = ItemList && itemlist.length>0){            varCurrentTime =NewDate (); $.each (ItemList,function(I, item) {varTime =Item.time; varstr =time.tostring (); //convert yyyy-mm-dd HH:mm:ss to Yyyy/mm/dd HH:mm:ss                varVistertime =NewDate (Str.replace (/-/g, "/")); varHaomiao = Currenttime.gettime ()-Vistertime.gettime (); //one minute is 1000 milliseconds.                //This compares the results of the new assignment to time, if true indicates more than 10 minutes, true=1                if(haomiao-10*60*1000>0) {Item.time=0; }Else{item.time= 1;//just dropping by.                }            }); }

This problem compared pit, in this point to hope you less detours, can smooth the bug out! Come on

iOS does not support date formats for 2017-09-09

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.