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参数设定的格式
});
});

js new Date() 测试的更多相关文章

  1. JS的Date对象、Math、包装类

    Date对象 在JS使用Date对象来表示时间  当前时间 var d = new Date();  指定时间 格式:月/日/年 时:分:秒 var e = new Date("02/16/ ...

  2. JavaScript基础17——js的Date对象

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  3. js对Date对象的操作的问题(生成一个倒数7天的数组)

    今天在论坛上看到这样一个问题如下: 问题描述: 使用JavaScript生成一个倒数7天的数组.比如今天是10月1号,生成的数组是["9月25号","9月26号" ...

  4. javascript得知 - js的Date对象函数

    js的Date功能很强大.通常使用. 首先获得当前的日期: var CurDate = new Date(); var Year = CurDate.getFullYear(); //年份(四位 例: ...

  5. 『开源』扩展 JS 的 Date 处理函数

    背景: JS 有自己的 时间类型 Date  —— 但是,在某些情况下 这个对象似乎 不太好用. 本文 基于 JQuery 扩展了一些  JS日期函数,包括: > 字符串 转 Date 对象 万 ...

  6. JS将/Date(1446704778000)/转换成str

    JS将/Date(1446704778000)/转换成str:var dateStr = eval(ele.add_time.replace(/\/Date\((\d+)\)\//gi, " ...

  7. JS日期Date详解与实例扩展

    一:Date类型介绍 要创建一个日期对象,使用new操作符和Date构造函数即可: var now = new Date(); Date.parse()方法 其中Date.parse()方法接收一个表 ...

  8. Chromimu与JS交互的测试

    CHROMIMU与JS交互的测试 好东西 谷歌浏览器 学习 研究  http://blog.csdn.net/grassdragon/article/details/51659798 Chromimu ...

  9. js转换Date日期格式

    有时候做项目会用到js的date日期格式,因为Date()返回的格式不是我们需要的, Date()返回格式: Thu Mar 19 2015 12:00:00 GMT+0800 (中国标准时间) 而我 ...

随机推荐

  1. lambda常用方法

    一:forEach()  循环遍历 List<Integer> costBeforeTax = Arrays.asList(100, 200, 300, 400, 500); costBe ...

  2. BUUOJ reverse 不一样的flag

    不一样的flag 是不是做习惯了常规的逆向题目?试试这道题,看你在能不能在程序中找到真正的flag!注意:flag并非是flag{XXX}形式,就是一个’字符串‘,考验眼力的时候到了! 注意:得到的 ...

  3. sql server备份损坏

    sql server备份损坏 转自:https://www.cnblogs.com/zhijianliutang/p/4080916.html 1.备份文件和数据库放在同一个(或一组)的物理磁盘上.磁 ...

  4. node工具之nodemon

    nodemon nodemon是一种工具,可以自动检测到目录中的文件更改时通过重新启动应用程序来调试基于node.js的应用程序. 安装 npm install -g nodemon //或 npm ...

  5. HDFS中NameNode管理元数据机制

    NameNode职责 响应客户端请求 维护目录树 管理元数据(查询,修改) HDFS元数据存储 内存中有一份完整的元数据(特定数据结构) 磁盘有一个“准完整”的元数据的镜像文件 当客户端对HDFS中的 ...

  6. JSP和JSTL视图解析器

    使用JSTL users.jsp <%@ page language="java" contentType="text/html; charset=UTF-8&qu ...

  7. JAVA网络编程入门

    JAVA网络编程入门 软件结构 C/S结构 B/S结构 无论哪一种结构,都离不开网络的支持.网络编程,就是在网络的条件下实现机器间的通信的过程 网络通信协议 网络通信协议:通信双方必须同时遵守才能完成 ...

  8. Spring框架中<mvc:default-servlet-handler/>的作用

    优雅REST风格的资源URL不希望带 .html 或 .do 等后缀.由于早期的Spring MVC不能很好地处理静态资源,所以在web.xml中配置DispatcherServlet的请求映射,往往 ...

  9. python多线程之_thread

    多线程类似于同时执行多个不同程序,多线程运行有如下优点: 使用线程可以把占据长时间的程序中的任务放到后台去处理. 用户界面可以更加吸引人,这样比如用户点击了一个按钮去触发某些事件的处理,可以弹出一个进 ...

  10. qq游戏IE组件停止工作

    你可以下载一个腾讯电脑管家,利用电脑诊所里的腾讯游戏专区里的“网页游 游戏玩不了”这一项修复一下即可.我遇见一次,修复之后就解决了.个人认为是Adobe Flash出问题了.祝你玩的开心.