js new Date() 测试
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() 测试的更多相关文章
- JS的Date对象、Math、包装类
Date对象 在JS使用Date对象来表示时间 当前时间 var d = new Date(); 指定时间 格式:月/日/年 时:分:秒 var e = new Date("02/16/ ...
- JavaScript基础17——js的Date对象
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- js对Date对象的操作的问题(生成一个倒数7天的数组)
今天在论坛上看到这样一个问题如下: 问题描述: 使用JavaScript生成一个倒数7天的数组.比如今天是10月1号,生成的数组是["9月25号","9月26号" ...
- javascript得知 - js的Date对象函数
js的Date功能很强大.通常使用. 首先获得当前的日期: var CurDate = new Date(); var Year = CurDate.getFullYear(); //年份(四位 例: ...
- 『开源』扩展 JS 的 Date 处理函数
背景: JS 有自己的 时间类型 Date —— 但是,在某些情况下 这个对象似乎 不太好用. 本文 基于 JQuery 扩展了一些 JS日期函数,包括: > 字符串 转 Date 对象 万 ...
- JS将/Date(1446704778000)/转换成str
JS将/Date(1446704778000)/转换成str:var dateStr = eval(ele.add_time.replace(/\/Date\((\d+)\)\//gi, " ...
- JS日期Date详解与实例扩展
一:Date类型介绍 要创建一个日期对象,使用new操作符和Date构造函数即可: var now = new Date(); Date.parse()方法 其中Date.parse()方法接收一个表 ...
- Chromimu与JS交互的测试
CHROMIMU与JS交互的测试 好东西 谷歌浏览器 学习 研究 http://blog.csdn.net/grassdragon/article/details/51659798 Chromimu ...
- js转换Date日期格式
有时候做项目会用到js的date日期格式,因为Date()返回的格式不是我们需要的, Date()返回格式: Thu Mar 19 2015 12:00:00 GMT+0800 (中国标准时间) 而我 ...
随机推荐
- centos 7中命令记录
cd:cd /data 切换文件夹到/data cd ..回到上级文件夹 cd ~ 回到家目录 cd 默认回到家目录cd - 回到刚刚离开的目录(只能回一次) pwd 显示当前目录路径 tim ...
- 小菜鸟之JAVA面试题库1
四次挥手 客户端发送释放连接报文,关闭客户端到服务端的数据传输 服务端收到后,发送确认报文给客户端 服务端发送释放连接报文,关闭服务端到客户端的数据传输 客户端发送一个确认报文给服务端 ------- ...
- 使用Python基于VGG/CTPN/CRNN的自然场景文字方向检测/区域检测/不定长OCR识别
GitHub:https://github.com/pengcao/chinese_ocr https://github.com/xiaofengShi/CHINESE-OCR |-angle 基于V ...
- Robot Framework(三)项目实践出现的问题以及解决方法
导航: 1.元素定位失败 2.系统自带的确认弹窗 3.ElementNotVisibleException: Message: element not visible 1.元素定位失败(使用frame ...
- eclipse运行jsp出现404错误怎么办?
Window/Show View/Other/Server/Servers/双击“Tomcat v7.0 Server at localhost”在Server Locations配置中选择第二个选项 ...
- API 网关性能比较:NGINX vs. ZUUL vs. Spring Cloud Gateway vs. Linkerd
前几天拜读了 OpsGenie 公司(一家致力于 Dev & Ops 的公司)的资深工程师 Turgay Çelik 博士写的一篇文章(链接在文末),文中介绍了他们最初也是采用 Nginx 作 ...
- redis 学习(3)-- String 类型
redis 学习(3)-- String 类型 String-结构 结构:Key-Value对 Value:可以是字符串.数字,也可以是二进制数组 限制:Value最大值为512MB String-常 ...
- java实现的LinkedLilst
package javabean.adt.List; import java.util.ConcurrentModificationException; import java.util.Iterat ...
- sql--ALTER
ALTER TABLE 语句 ALTER TABLE 语句用于在已有的表中添加.修改或删除列. SQL ALTER TABLE 语法 如需在表中添加列,请使用下列语法: ALTER TABLE tab ...
- 测试用例管理工具-TestLink
TestLink是基于web的测试用例管理系统,主要功能是测试用例的创建.管理和执行,并且还提供了一些简单的统计功能,主要功能包括: 测试需求管理 测试用例管理 测试用例对测试需求的覆盖管理 测试计划 ...