<script> var today = new Date(); document.getElementById("login_date_time").value = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate()+" "+ today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds(); </script>