dedecms自定義表單怎麼新增發布時間功能

黄文Rex發表於2024-08-05
<input type="text" name="shijian" id="shijian" value=""> 
<script type="text/javascript"> 
window.onload = function(){ 
var nowDate = new Date(); 
var str = nowDate.getFullYear()+"-"+(nowDate.getMonth() + 1)+"-"+nowDate.getDate()+" "+nowDate.getHours()+":"+nowDate.getMinutes()+":"+nowDate.getSeconds(); 
document.getElementByIdx_x("shijian").value=str; 
} //phpfensi.com 
</script>

相關文章