JS Date
2024-10-11 00:08:11
JS获取当前日期时间
var myDate = new Date();
myDate.getFullYear(); //获取完整的年份(4位,1970-????)
myDate.getMonth(); //获取当前月份(0-11,0代表1月)
myDate.getDate(); //获取当前日(1-31)
myDate.getDay(); //获取当前星期X(0-6,0代表星期天)
myDate.getTime(); //获取当前时间(从1970.1.1开始的毫秒数)
myDate.getHours(); //获取当前小时数(0-23)
myDate.getMinutes(); //获取当前分钟数(0-59)
myDate.getSeconds(); //获取当前秒数(0-59)
myDate.getMilliseconds(); //获取当前毫秒数(0-999)
myDate.toLocaleDateString(); //获取当前日期
myDate.toLocaleTimeString(); //获取当前时间
myDate.toLocaleString( ); //获取日期与时间
转载:http://www.cnblogs.com/carekee/articles/1678041.html
最新文章
- python运算符重载
- 根据用户IP获得所在城市
- aptana studio 3 自动换行(无需插件)
- CENTOS纯手工安装LAMP+PHPMYADMIN
- Multi-touch.
- 在Fedora 23 Server和Workstation上安装LAMP(Linux, Apache, MariaDB和PHP)
- Android 测试 Appium、Robotium、monkey等框架或者工具对比
- CubeSuit+ ( CS+ for ca )
- [CEOI2008]order
- Java 线程安全LocalTime 和LocaldateTime 新的Date和Time类 -JDK8新时间类的简单使用
- Python面向对象之魔术方法
- Bootloader升级方式一————擦、写flash在RAM中运行
- Spark设计理念与基本架构
- js 把一个对象赋值给另一个对象会指向同一个内存地址
- python中global和nonlocal用法的详细说明
- spring boot 2.0.3+spring cloud (Finchley)1、搭建服务注册和发现组件Eureka 以及构建高可用Eureka Server集群
- 创建一个Maven Web应用程序
- 线程 Thread Handler
- [LeetCode] 711. Number of Distinct Islands II_hard tag: DFS
- [C#学习笔记]C#中的decimal类型——《CLR via C#》