localStorage

将数组转换成json后,存入localStorage

https://my.oschina.net/crazymus/blog/371757

http://blog.csdn.net/u011413061/article/details/49999785 

时间函数:

function compareTime(myTime) {
        var currentTime = new Date;
        var myArray = Array();
        myArray[0] = currentTime.getFullYear();
        myArray[1] = currentTime.getMonth();
        myArray[2] = currentTime.getDate();
        myArray[3] = currentTime.getHours();
        myArray[4] = currentTime.getMinutes();
        myArray[5] = currentTime.getSeconds();
        for (var i in myArray){
            console.log("myArray"+[i]+": "+myArray[i]);
        }
        for (var x=0; x<4 ; x++){
            if (myArray[x]);
        }
     }

  

posted @ 2016-11-29 00:03  aWolfMan  阅读(168)  评论(0编辑  收藏  举报