博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
获取当前日期格式:YYYY-MM-DD
阅读量:6879 次
发布时间:2019-06-26

本文共 498 字,大约阅读时间需要 1 分钟。

//获取当前时间,格式YYYY-MM-DDfunction getNowFormatDate() {    var date = new Date();    var seperator1 = "-";    var year = date.getFullYear();    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 = year + seperator1 + month + seperator1 + strDate;    return currentdate;}

 

转载于:https://www.cnblogs.com/leebokeyuan/p/9224049.html

你可能感兴趣的文章
Log4j按级别输出日志到不同文件配置分析
查看>>
搭建nginx服务器
查看>>
java 运行 jar classpath配置
查看>>
go thrift oprot.Flush() not enough arguments in
查看>>
使用 Tomcat 7 新的连接池 —— Tomcat jdbc pool
查看>>
Spring MVC 介绍
查看>>
博客用途声明---重要
查看>>
linux .la .lo文件以及libtool介绍
查看>>
写python如何组织代码
查看>>
我的友情链接
查看>>
visual studio在浏览器中查看与运行的区别
查看>>
读书清单(2018书单)
查看>>
我的友情链接
查看>>
HTML滚动文字代码
查看>>
c#之旅--第二天
查看>>
vim复制粘贴大全
查看>>
几个Office使用中的小问题解决方法汇总
查看>>
常见硬盘加密解密的4种方法解析
查看>>
(10)MATLAB 模式识别
查看>>
OpenSSH配置文件详解
查看>>