• Post Reply Bookmark Topic Watch Topic
  • New Topic

JavaScript help needed!

 
fengzixuan zheng
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i get a standard concurrent time (from some web server) in my JavaScript codes.
Please give a example.
Thanks.
[This message has been edited by fengzixuan zheng (edited November 12, 2001).]
 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well if you want to display it via javascript in the web browser, but you want to get it from the server, you have a problem, since the server can only give the browser the time info at the moment it processes the HTTP request.
so you might as well display the time value in HTML immediately rather than doing anything with javascript.
if it has to be the current time, then your javascript on your browser will have to set off another call to the server to get the time.
if you actually want to do it all client-/browser-side with the time stamp obtained from the surfer's machine, you could do some javascript with something like:
dtmNow = new Date();
but i'm not totally sure. check out the html & javascript forum.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!