zoukankan      html  css  js  c++  java
  • (一)IOS new Date()

    IOS使用new Date()会出现 Invalid Date、NaN-NaN等情况

    原因:new Date(),new Date('2019-01-01'),new Date('2019-01-01 0:00:00')在IOS中不支持

    但new Date('2019-01-01T0:00:00')格式在IOS中支持

    public dates: Array<Date> = [];
    this.dates.push(new Date('2019-08-25T15:29:44.459086'));
    this.dates.push(new Date('2019-08-26 00:00:00'));
    this.dates.push(new Date('2019-08-27'));
    this.dates.push(new Date(Date.parse('2019-08-25T15:29:44.459086')));
    this.dates.push(new Date(Date.parse('2019-08-26 00:00:00')));
    this.dates.push(new Date(Date.parse('2019-08-27')));
    this.dates.push(new Date(Date.parse('2019-08-25T00:00:00.000000')));
    this.dates.push(new Date(Date.parse('2019-08-26T00:00:00.00000')));
    this.dates.push(new Date(Date.parse('2019-08-27T00:00:00.000000Z')));
    this.dates.push(new Date(Date.parse('2019-08-28T00:00:00.00000Z')));
    this.dates.push(new Date(Date.parse('2019-08-29T00:00:00.000Z')));
    this.dates.push(new Date());
    let curr = new Date();
    let str = `${TimeHelper.Date2String(curr, 'YYYY-MM-DD')}T00:00:00.000000`;
    curr = new Date(Date.parse(str));
    console.log(str);
    this.dates.push(curr);
    this.dates.push(new Date(new Date().toDateString()));
    this.dates.push(new Date(`${TimeHelper.Date2String(new Date(), 'YYYY-MM-DD')}`));
    this.dates.push(new Date(Date.parse('2019-08-26')));
  • 相关阅读:
    杂七杂八注意
    数字和表达式
    小总结
    层级定位
    webdriver对象定位方法
    自动化测试第一季-selenium + python(环境搭建与基础代码解释)
    补基础—.—
    1-13 代理ARP和RARP
    Nginx/LVS/HAProxy负载均衡软件的优缺点详解
    分布式集群系统下的高可用session解决方案
  • 原文地址:https://www.cnblogs.com/chendongbky/p/11416744.html
Copyright © 2011-2022 走看看