Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    server time on my page

    I need to display time that is currently on my web server on a webpage. All the scripts I have seen display only time on the clients machine. Could you please help

  • #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72 W. 48' 57" , 41 N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    ...

    this is the client side forum. if you want to do something involving the server, you need to ask in the server side forum.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    The Planet Earth Code Poet: True
    Posts
    282
    Thanks
    0
    Thanked 1 Time in 1 Post
    Moving to the server-side forum

  • #4
    Regular Coder
    Join Date
    May 2002
    Location
    London, England
    Posts
    369
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Got PHP? This will work

    PHP Code:
    <?
    echo date("l j F Y");
    ?>
    Jee
    Jeewhizz - MySQL Moderator
    http://www.sitehq.co.uk
    PHP and MySQL Hosting

  • #5
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Dave,
    I am a begginer in this so I from what I understand server-side language is VB. Its a site running Front Page Server Extentions and ASP pages. Hope this can help. Thanks in advance

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Plano, Texas
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This Code In ASP:
    Code:
    <html>
    <body>
    <%
    dim todaysDate 
    todaysDate=now() 
    %>   
    <%
    Response.write todaysDate 
    Response.write("<br>")
    %>   
    
    <%
    Response.write FormatDateTime(todaysDate,0) 
    Response.write("<br>")
    %>   
    
    <%
    Response.write FormatDateTime(todaysDate,1) 
    Response.write("<br>")
    %>   
     
    <%
    Response.write FormatDateTime(todaysDate,2) 
    Response.write("<br>")
    %>   
    
    <%
    Response.write FormatDateTime(todaysDate,3) 
    Response.write("<br>")
    %>   
     
    <%
    Response.write FormatDateTime(todaysDate,4) 
    %>
    </body>
    </html>

    Will Produce The Server Time In This Format:

    6/18/2002 3:59:24 PM
    6/18/2002 3:59:24 PM
    Tuesday, June 18, 2002
    6/18/2002
    3:59:24 PM
    15:59

  • #7
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks a lot that helped a lot. Now comes the tricky part. How do I update the time every second. I need people to see the time changing. Thanks 1000 times!

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Location
    Plano, Texas
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It can be done by calcukating GMT difference from your server time zone.

    Visit this page:

    http://tech.irt.org/articles/js076/index.htm

    Several tips to do what you are looking for.

  • #9
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    http://www.google.com/search?hl=en&i...vascript+clock
    Should give you some good tutorials on using javascript to manipulate time.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •