var t =  new Date().toString(); //t =  "Thu Oct 31 2019 11:36:57 GMT+0800 (中国标准时间)"
var t1 = new Date();
var data_arry =[];
var that = new Date();
data_arry.push(that.constructor()); // Thu Oct 31 2019 11:50:26 GMT+0800 (中国标准时间)"
data_arry.push(that.getDate()); //
data_arry.push(that.getDay()); //
data_arry.push(that.getFullYear()); //
data_arry.push(that.getHours()); //
data_arry.push(that.getMilliseconds()); //
data_arry.push(that.getMinutes()); //
data_arry.push(that.getMonth()); //
data_arry.push(that.getSeconds()); //
data_arry.push(that.getTime()); //
data_arry.push(that.getTimezoneOffset()); //-480
data_arry.push(that.getUTCDate()); //
data_arry.push(that.getUTCDay());
data_arry.push(that.getUTCFullYear());
data_arry.push(that.getUTCHours());
data_arry.push(that.getUTCMilliseconds());
data_arry.push(that.getUTCMinutes());
data_arry.push(that.getUTCMonth());
data_arry.push(that.getUTCSeconds());
data_arry.push(that.getYear());
data_arry.push(that.setDate());
data_arry.push(that.setFullYear());
data_arry.push(that.setHours());
data_arry.push(that.setMilliseconds());
data_arry.push(that.setMinutes());
data_arry.push(that.setMonth());
data_arry.push(that.setSeconds());
data_arry.push(that.setTime());
data_arry.push(that.setUTCDate());
data_arry.push(that.setUTCFullYear());
data_arry.push(that.setUTCHours());
data_arry.push(that.setUTCMilliseconds());
data_arry.push(that.setUTCMinutes());
data_arry.push(that.setUTCMonth());
data_arry.push(that.setUTCSeconds());
data_arry.push(that.setYear());
data_arry.push(that.toDateString());
data_arry.push(that.toGMTString());
//data_arry.push(that.toISOString()); 报错
data_arry.push(that.toJSON());
data_arry.push(that.toLocaleDateString());
data_arry.push(that.toLocaleString());
data_arry.push(that.toLocaleTimeString());
data_arry.push(that.toString());
data_arry.push(that.toTimeString());
data_arry.push(that.toUTCString());
data_arry.push(that.valueOf());
    function get_nowtime() {
var date = new Date();
return (date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate());
}
console.log(get_nowtime());
        function get_nowtime() {
function format(str) {
str += "";
if (str.length < 2) {
str = "0" + str;
}
return str;
}
var date = new Date();
return (date.getFullYear() + '-' + format((date.getMonth() + 1)) + '-' + format(date.getDate()));
}

js  时间字符串转时间

      layui.use('laydate', function () {
var laydate = layui.laydate;
laydate.render({
elem: '#test1'
,format: 'yyyy-MM-dd' //可任意组合,
, value: new Date(document.getElementById('test1').value) //必须遵循format参数设定的格式
});
});

最新文章

  1. iOS开发多线程篇—自定义NSOperation
  2. hdoj 2040
  3. [方法] Windows 下SSH远程连接Linux
  4. poj 2155
  5. mac 下mysql
  6. Redis常见的应用场景解析
  7. Day4 装饰器——迭代器——生成器
  8. C#梳理【集合Collection】
  9. 二叉苹果树|codevs5565|luoguP2015|树形DP|Elena
  10. [转载]Oracle修改用户表所属表空间的步骤
  11. cmake 添加头文件目录,链接动态、静态库
  12. ML(4): 决策树分类
  13. 初识HDFS原理及框架
  14. 北京Uber优步司机奖励政策(2月29日)
  15. php创建token
  16. java编程将命令行参数转化为整数并实现求和的功能。
  17. [codeforces] 527A Playing with Paper
  18. 详细讲解:使用tp3.2.3完成简单的注册登录功能
  19. mongoDB学习笔记——在C#中查询
  20. Facebook的早期历史

热门文章

  1. c++ | final
  2. 第三周课程总结&amp;实验报告一
  3. ZooKeeper常用命令行操作
  4. 从入门到自闭之python三大器--装饰器进阶
  5. jQuery导出word文档
  6. 牛客 545C 出题人的数组 (贪心)
  7. 关于Android studio调用高德地图的简单流程和要点
  8. 四、redis学习(案例)
  9. 转换byte(十进制)为图形(大小写字母,符号)
  10. 解决stackoverflow加载慢的插件