如何将获取并格式化当前时间的过程描述成一个长尾?
- 内容介绍
- 文章标签
- 相关推荐
本文共计113个文字,预计阅读时间需要1分钟。
javascriptfunction getNowFormatDate() { var date=new Date(); var separator1=-; var separator2=:; var month=date.getMonth() + 1; var strDate=date.getDate(); if (month <10) month=0 + month; if (strDate < 10) strDate=0 + strDate; return date.getFullYear() + separator1 + month + separator1 + strDate + + date.getHours() + separator2 + date.getMinutes() + separator2 + date.getSeconds();}
gistfile1.txtfunction 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; }
本文共计113个文字,预计阅读时间需要1分钟。
javascriptfunction getNowFormatDate() { var date=new Date(); var separator1=-; var separator2=:; var month=date.getMonth() + 1; var strDate=date.getDate(); if (month <10) month=0 + month; if (strDate < 10) strDate=0 + strDate; return date.getFullYear() + separator1 + month + separator1 + strDate + + date.getHours() + separator2 + date.getMinutes() + separator2 + date.getSeconds();}
gistfile1.txtfunction 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; }

