关于Date对象的使用
2015-10-10 10:59
302 查看
代码示例如下;
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus?"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <title>Date对象</title> </head> <body> <script type="text/javascript"> <!-- /* Date对象:1.拿到当前时间:new Date() ; 2.拿到年月日,时分秒: getXXX() ; */ var d = new Date() ; alert(d.toLocaleString()) ; alert(d.getYear()) ; alert(d.getMonth()); //老外是从0 开始 alert(d.getDate()) ; alert(d.getDay()) ; //--> </script> </body> </html>
相关文章推荐
- 关于JavaScript的window对象的三种对话框
- 关于JavaScript的window对象的opener及parent属性
- 关于JavaScript的window对象的status属性
- JS类的封装及实现代码【转】
- PHP获取当前页面完整URL地址
- 将异常信息存储到日志文件中
- Kendo UI Professional Q3 2015正式发布[附下载]
- static和extern的总结
- C++primer第五版笔记-第十二章动态内存
- 网站发布
- oracle分析函数——keep
- 一步步教你使用Proguard混淆Java源代码
- address already in use: jvm_bind:9999
- vim实用配置
- Android 调用已安装市场,进行软件评分的功能实现
- 关于JavaScript的几种常见的全局函数
- 关于JavaScript的函数劫持
- 关于JavaScript的函数定义及调用
- linux时间类型
- JavaScript的数据类型,运算符及数据类型之间的转化