first commit

This commit is contained in:
yangshuimiao
2023-10-16 12:58:41 +08:00
commit 3a09f3ca67
1512 changed files with 570984 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<script>
function formatDate(date) {
console.log(date);
date=date.replace(/-/g,'');
console.log(date);
// date = new Date();
date = new Date(Date.parse(date.replace(/-/g, "/"))); //转换成Data();
console.log(date);
var y = date.getFullYear();
console.log(y);
var m = date.getMonth() + 1;
m = m < 10 ? '0' + m : m;
var d = date.getDate();
d = d < 10 ? ('0' + d) : d;
return y + '-' + m + '-' + d;
}
formatDate('2020-02-02');
var a = ""
function aa() {
a="hh"
}
aa() // 注意,aa() 一定要执行,局部赋值全局变量才会有作用
alert(a)
</script>