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')));
  • 相关阅读:
    PHP Socket 编程详解
    PHPWord生成word实现table合并(colspan和rowspan)
    PhpExcel中文帮助手册|PhpExcel使用方法
    js限制input标签中只能输入中文
    如何巧用.htaccess设置网站的压缩与缓存
    Linux xargs命令
    PHP加密解密类
    2014 年10个最佳的PHP图像操作库
    学习swoft的第二天_注解
    学习swoft的第一天
  • 原文地址:https://www.cnblogs.com/chendongbky/p/11416744.html
Copyright © 2011-2022 走看看