Click here to Skip to main content
15,898,991 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have some javascript code to find the local computer date and time. because our server in US. We are in Malaysia. It will pick up the US Time. I need to store the result into mssql database table
si i need to display the result in text box control

so below code
JavaScript
<script type="text/javascript">
                var currentTime = new Date()
                var month = currentTime.getMonth()
                var day = currentTime.getDate()
                var year = currentTime.getFullYear()
                var hours = currentTime.getHours()
                var minutes = currentTime.getMinutes()
                var seconds = currentTime.getSeconds()
                var miliseconds = currentTime.getMilliseconds()

                if (minutes < 10) {
                    minutes = "0" + minutes
                }
                if (seconds < 10) {
                    seconds = "0" + seconds
                }
                document.write(year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds + ":" + miliseconds)
</script>


What I have tried:

Really I don't know how to do.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900