JS Date日期
//日期属性
var td = new Date();
alert( "getDate():" +td.getDate()+"\n" +
"getDay():" +td.getDay()+ "\n" +
"getMonth()" +td.getMonth()+"\n"+
"getFullYear()" +td.getFullYear()+"\n"+
"toString()" +td.toString()+"\n"+
"toTimeString()"+td.toTimeString()+"\n"+
"toDateString()"+td.toDateString()+"\n");
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAARIAAAB3CAIAAABAG1gpAAAPL0lEQVR4nO2d72/bxhnHBQxIOrQruq5rU8fSnzHD2FAP3as2TaOtMdaisNehwAq1dVKhW7u69psW7ZxExgJsBaZ4L9b8qLehNYLBjhFbUhI1Qd1IFkWKagvMGOJUcS3mn9gLiuQd7zlSJx5NSnmED4KEIe/447684/H58klUdxUEQYRIRL4HCNJ3oGwQRJjgslmZGUsQv8m8jN1anh9NZBbymcTI/AqwQnV2xKpvYslzIYKEQG+yWZkZs5sm+XelujTp12rp9UGqsyNjs8udlUdnqq4VFiY6/2tKxRQquBBBQkG2bHZ9W62/bPIZWoeZBc89YXUFLkQQaZCyWZjojHFGZ+YnE/bN21luDpmcfybGZpcBGRBL3AMn17Zs4Yq70ds9T3V2JAH1PIBEwYUIIg1bNgsTCaoDIZq13VhtPXj2NuRqGUt7S5PWYw+5Pli4q9Fb/4RkAz78cJ+IEEQSlmyWyO6F+OfSZIL+jcyvdCEbp30vz4/SswXE+mDhzoMNUBpJPpNgx2/gQgSRSxeyoRqxiads7E2qsyP20Mt54KFlAxTO6W1oUDNIhHQzSHNUkc+wAy12Js3qHAhVLM+PcgZpbOHkyI3QmzNIW5kZY4dh4EIECQViSsB5fKenBKD3IZ2hlzUl4Pzc4ytr9JWZtKfXiG3hwuGZNFs27qEdf2HUJxcZVDgT0PDwyYsbd7RySw3IjTtaddf3vQ2CRIwtm5WZMfsRYmEiITDg2djRNna0WltXjaYWjFpbN0vziRJAkEgBB2lijXVjRzMbvRoYs5wvdrTIzwuCeBA0Ju36HVVp61I0Yyun1tZv3FEjPzUIwiOob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gyaYvPGoom0FgsGSDIHsCygZBhPk/80xPHAiqIrgAAAAASUVORK5CYII=" alt="" width="276" height="119" />
new Date("09-12-2013") //正确
new Date("2013-12-09") //错误
JS Date日期的更多相关文章
- js Date 日期格式化(转)
var myDate = new Date();myDate.getYear(); //获取当前年份(2位)myDate.getFullYear(); //获取完整的年份(4位,1 ...
- js Date()日期函数浏览器兼容问题解决方法
一般 直接new Date() 是不会出现兼容性问题的,而 new Date(datetimeformatstring) 常常会出现浏览器兼容性问题,为什么,datetimeformatstring中 ...
- js Date日期对象的扩展
// 对Date的扩展,将 Date 转化为指定格式的String// 月(M).日(d).小时(h).分(m).秒(s).季度(q) 可以用 1-2 个占位符, // 年(y)可以用 1-4 个占位 ...
- js动态获取当前系统时间+js字符串转换为date日期对象
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ ...
- JS Date当前时间:获取日期时间方法在各浏览器中的差异
转自:http://www.feiesoft.com/00047/<script type="text/javascript"> // JS Date当前时间获取方法在 ...
- js中转换Date日期格式
在javascript中直接输出Date得到的结果是这样的: function date(){ var date = new Date(); alert(date); } 结果是:Mon Jun 15 ...
- js转换Date日期格式
有时候做项目会用到js的date日期格式,因为Date()返回的格式不是我们需要的, Date()返回格式: Thu Mar 19 2015 12:00:00 GMT+0800 (中国标准时间) 而我 ...
- JS内置对象-String对象、Date日期对象、Array数组对象、Math对象
一.JavaScript中的所有事物都是对象:字符串.数组.数值.函数... 1.每个对象带有属性和方法 JavaScript允许自定义对象 2.自定义对象 a.定义并创建对象实例 b.使用函数来定义 ...
- js Date 函数方法及日期计算
js Date 函数方法 var myDate = new Date(); myDate.getYear(); //获取当前年份(2位) myDate.getFullYear(); //获取完整的年份 ...
随机推荐
- Nginx配置端口访问的网站
server { listen 80; #listen [::]:80 default_server ipv6only=on; server_name www.website.com; index i ...
- QQ钱包,微信,京东钱包,百度钱包,支付宝AGENT
微信Mozilla/5.0 (Linux; Android 7.0; LON-AL00 Build/HUAWEILON-AL00; wv) AppleWebKit/537.36 (KHTML, lik ...
- jquery二维码生成插件jquery.qrcode.js
插件描述:jquery.qrcode.js 是一个能够在客户端生成矩阵二维码QRCode 的jquery插件 ,使用它可以很方便的在页面上生成二维条码. 转载于:http://www.jq22.com ...
- shell基础复习笔记
变量的设置 以等号连接,等号两边不能有空格 变量名首个字符必须是英文,可以使用下划线,不能使用标点符号,不能使用bash里的关键字 可以使用转义字符\将特殊符号(如Enter.$.空格.!等)变成一般 ...
- Node.js权威指南学习记录
学习nodeJS权威指南的学习记录 导航: 1.console模块 2.全局变量 3.Buffer对象 4.事件对象 5.网络请求 6.文件操作对象 一. COMMON.js的学习.(commonJS ...
- 深入理解c/c++ 内存对齐
内存对齐,memory alignment.为了提高程序的性能,数据结构(尤其是栈)应该尽可能地在自然边界上对齐.原因在于,为了访问未对齐的内存,处理器需要作两次内存访问:然而,对齐的内存访问仅需要一 ...
- hibernate框架环境搭建与使用
搭建环境 一.新建一个项目 , 导包 一个是hibernate的jar包,一个是jdbc的jar包 hibernate的jar包 这些jar包全部导入 二.配置Hibernate. 1.建立hib ...
- webpack 使用中的问题
用gulp-watch代替watch webpack打包体积分析器 集合
- 记录一个因sqlmap导致的错误
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE sqlMap PUBLIC "- ...
- FFmpeg再学习 -- 视音频基础知识
最近一直在看雷霄骅 FFmpeg 系列视频,然后将自己的理解总结一下. 参看:<基于 FFmpeg + SDL 的视频播放器的制作>课程的视频 一.视频播放器原理 自己理解: 比如一个 M ...