view server time

Discussion in 'Javascript' started by john, Sep 2, 2003.

  1. john

    john Guest

    Is it possible to display the current time directly from the server,
    and not client-side...I have people in different time zones trying to
    view the same page and the times (based on client) are coming up
    different.

    Thanks.
     
    john, Sep 2, 2003
    #1
    1. Advertisements

  2. john

    Evertjan. Guest

    john wrote on 02 sep 2003 in comp.lang.javascript:
    > Is it possible to display the current time directly from the server,
    > and not client-side...I have people in different time zones trying to
    > view the same page and the times (based on client) are coming up
    > different.


    1 by serverside code (ASP: Time is <%=now%> )

    2 by "GET"-ing the header:

    <script type="text/javascript">
    var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    xmlhttp.open("GET", "http://www.qwerty.com/", false);
    xmlhttp.send();
    alert(xmlhttp.getAllResponseHeaders().replace(/^(.*)[\s\S]*/,"$1"));
    </script>




    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Sep 2, 2003
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. engsol
    Replies:
    2
    Views:
    1,189
    Dan Bishop
    Jan 26, 2004
  2. Replies:
    8
    Views:
    770
    Magnus Lycka
    Aug 5, 2005
  3. flamesrock
    Replies:
    8
    Views:
    818
    Hendrik van Rooyen
    Nov 24, 2006
  4. Ro
    Replies:
    3
    Views:
    488
    Lawrence Kirby
    Jan 26, 2005
  5. Summu82
    Replies:
    5
    Views:
    1,139
    Richard Heathfield
    Jun 7, 2006
  6. Replies:
    1
    Views:
    1,026
    Paul Boddie
    Mar 11, 2007
  7. Ron Adam

    time.time or time.clock

    Ron Adam, Jan 13, 2008, in forum: Python
    Replies:
    9
    Views:
    559
    John Machin
    Jan 14, 2008
  8. Parthiv Joshi
    Replies:
    1
    Views:
    1,115
    Samuel L Matzen
    Jul 6, 2004
Loading...