Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Time

Status
Not open for further replies.

Ragol1

Programmer
Oct 25, 2001
315
US
I Use this to grab a time to add to a DB but I just want the time from the server


<script type=&quot;text/javascript&quot;>
function addDate(){
var now = new Date();
document.update.update_date.value = now;
document.update.submit();
}
</script>

It currently displays time like these
Tue Aug 27 13:09:49 PDT 2002
Tue Aug 27 23:15:47 UTC+0100 2002

All i want is for it to display the time the event happend at the server time
 
Javascript runs client side. That means the user's web browser does all the processing of the javascript after it has been downloaded from the server. Javascript cannot communicate with the server, and therefor cannot get the time from the server. If you want to display the current server time, you need to use a server side scripting language such as ASP or JSP. Find out what your web server software supports, and then it should be a straight forward process.

Cheyney
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top