js获取当前时间
来源:互联网 发布:centos 7服务器版安装 编辑:程序博客网 时间:2024/06/05 13:25
网上找了个js获取当前时间的函数,记录一下方便下次使用
function getNowFormatDate() {
var date = new Date();var seperator1 = "-";
var seperator2 = ":";
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
+ " " + date.getHours() + seperator2 + date.getMinutes()
+ seperator2 + date.getSeconds();
return currentdate;
}
阅读全文
0 0
- JS获取当前时间
- js获取当前时间
- js 获取当前时间
- Js获取当前时间
- js 获取当前时间
- js获取当前时间
- js获取当前时间
- js获取当前时间
- js获取当前时间
- JS获取当前时间
- JS获取当前时间
- JS获取当前时间
- js 获取当前时间
- js获取当前时间
- js获取当前时间
- js获取当前时间
- js获取当前时间
- JS获取当前时间
- 安装latexdiff
- tf.nn.softmax_cross_entropy_with_logits()
- 如何用eclipse创建你的第一个servlet小程序
- JS--Array的常用方法map、reduce、filter、forEach、indexOf
- oracle biee 12c windows install
- js获取当前时间
- 电子技术相关网站
- c++ char与二进制互转
- nyoj--290--动物统计加强版
- Uvalive 7503
- debian9 ping 提示connect: network is unreachable 问题的解决
- SpringMVC HandlerInterceptorAdapter
- 对构成三角形规则的决策表合并优化方法
- Jvm对自己的内存划分了五个区域