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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    dynamic server time

    Hi all,
    i am trying to display a dynamic Clock at my pages, i want to display the server's time. i could do this by simply writing
    <%= FormatDateTime(Now, 3)%><%= FormatDateTime(Date, 1) %>
    but this displays a static time.
    i found another way for displaying dynamic time,in fact a VBScript code, but this gives me the client's time.
    how can i display the server's time dynamically?
    regards,

  • #2

  • #3
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank you but could this be done on an ".shtm" not only ".asp"?

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    You cannot add server-side scripts in .stm, .shtm, or .shtml files. Those extensions are only set up for Server-Side Includes (SSI).

  • #5
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    can i make a dynamic server time? in either extentions? i could only make a static server time by changing the file into .asp!

  • #6
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    just get a javascript clock script, and set it's original time (when the script is loaded) to the server's time

    ie instead of
    var datStartTime = ...clients time
    increment every second and do other stuff like that

    do
    var datStartTime = <%=Time()%>;
    increment every second and do other stuff like that

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    Quote Originally Posted by ghell
    just get a javascript clock script, and set it's original time (when the script is loaded) to the server's time

    ie instead of
    var datStartTime = ...clients time
    increment every second and do other stuff like that

    do
    var datStartTime = <%=Time()%>;
    increment every second and do other stuff like that
    That's essentially my suggestion in the link I posted.

    G.A., is there any special reason behind your not using .asp extension? It's possible to make .htm files (or any extension for that matter) process asp scripts by mapping that extension to the asp.dll that handles execution of scripts. But why do that if you can already do it with .asp files?


  •  

    Posting Permissions

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