1
2
3
4
5
6
7
8
9
|
<script type=
"text/javascript"
>
//得到当前时间yyyy-MM-dd
var
myDate =
new
Date();
var
nowDate = myDate.getFullYear();
nowDate = nowDate + ((myDate.getMonth() + 1) < 10 ?
"-0"
+ (myDate.getMonth() + 1) :
"-"
+ (myDate.getMonth() + 1));
nowDate = nowDate + (myDate.getDate() < 10 ?
"-0"
+ myDate.getDate() :
"-"
+ myDate.getDate());
alert(nowDate);
</script>
|
获取系统当前时间 年月日
最新推荐文章于 2024-04-30 08:04:17 发布