zoukankan
html css js c++ java
Js获取当前日期时间
Js获取当前日期时间
var myDate = new Date();
myDate.getYear();
//获取当前年份(2位)
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();
//获取当前日期
var mytime=myDate.toLocaleTimeString();
//获取当前时间
myDate.toLocaleString( );
//获取日期与时间
查看全文
相关阅读:
K优先队列——对顶堆(两种优先队列的组合)
斐波那契数列——UPC
UPC-混合训练第十五场
隐写术之steghide的使用
常见的文件头文件尾
隐写术
1.6 创建新的虚拟机以及如何开启虚拟机
1.5 下载和安装VMWare
1.4 常见的网络协议
1.3 Windows注册表
原文地址:https://www.cnblogs.com/xiaohui1990/p/3431054.html
最新文章
[C]malloc(), free()函数的应用
[C]如何用strchr来找字符串中所有的char
DNS servers | set up a static ip address in Ubuntu
react native之使用AsyncStorage 进行数据持久化存储
react native之使用 Fetch进行网络数据请求
react navigation如何goBack到指定页面? 和使用react navigation跳转页面时传值。
React Native 中 static的navigationOptions中的点击事件不能用this
React Native 之react-native-sqlite-storage
React Native 之ScrollView
React Native 之TouchableOpacity组件
热门文章
React Native 之SectionList
React Native 之FlatList 下拉刷新和上拉加载更多
React Native 之FlatList
Ubuntu20.04(LTS)sources.list分享
牛客第五场 B Graph最小异或生成树
膜拜(离散化差分模板题)
牛客第六场-Combination of Physics and Maths
有关Linux系统出现Malformed line 1 in source list /etc/apt/sources.list (type)问题的解决方式
UPC-自习课 模拟题
做题总结——连续更
Copyright © 2011-2022 走看看