Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-26-2005, 09:41 AM   PM User | #1
G.A.
New to the CF scene

 
Join Date: Jan 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
G.A. is an unknown quantity at this point
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,
G.A. is offline   Reply With Quote
Old 01-26-2005, 10:08 AM   PM User | #2
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
http://www.codingforums.com/showthre...589#post211835
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 01-26-2005, 12:04 PM   PM User | #3
G.A.
New to the CF scene

 
Join Date: Jan 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
G.A. is an unknown quantity at this point
thank you but could this be done on an ".shtm" not only ".asp"?
G.A. is offline   Reply With Quote
Old 01-27-2005, 01:35 AM   PM User | #4
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
You cannot add server-side scripts in .stm, .shtm, or .shtml files. Those extensions are only set up for Server-Side Includes (SSI).
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 01-27-2005, 06:37 AM   PM User | #5
G.A.
New to the CF scene

 
Join Date: Jan 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
G.A. is an unknown quantity at this point
can i make a dynamic server time? in either extentions? i could only make a static server time by changing the file into .asp!
G.A. is offline   Reply With Quote
Old 01-27-2005, 08:28 AM   PM User | #6
ghell
Senior Coder

 
Join Date: Apr 2003
Location: England
Posts: 1,192
Thanks: 5
Thanked 13 Times in 13 Posts
ghell is on a distinguished road
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
__________________
My tech/code blog
ghell is offline   Reply With Quote
Old 01-27-2005, 12:19 PM   PM User | #7
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
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?
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:30 PM.


Advertisement
Log in to turn off these ads.