Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Clock
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Clock

 Post Reply Post Reply Page  <123
Author
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 24 June 2003 at 4:50pm

just put

<%
   Response.Write(hour(now()) & ":")
   If minute(now()) < 10 then
      response.write ("0" & minute(now()) & " " & second(now()))
   Else
      Response.write (minute(now()) & " " & second(now()))
   End If
%>



Edited by pmormr
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 24 June 2003 at 5:03pm
but that clock won't update every second... only when you hit refresh
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 24 June 2003 at 10:12pm

Originally posted by genmud genmud wrote:

you are wrong... if you can format the thing so that you can get the Hours, Minutes and Seconds i guarentee that i could get it!

am i now?  lesse.. i recall a reply on this post by you: "i dont know much ASP" or something along those lines.......

its glaringly obvious you have absolutely zero idea "how" server script works, otherwise you'd understand that the only way to have a server-side update is to refresh the page (read: VERY server intensive and unusable for your visitors)

but what do i know, i've only coded ASP for a living for 4 years now, i dont know jack crap i guess

Contribute to the working anarchy we fondly call the Internet
Back to Top
TYSON View Drop Down
Groupie
Groupie


Joined: 18 August 2002
Location: Australia
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote TYSON Quote  Post ReplyReply Direct Link To This Post Posted: 25 June 2003 at 7:07am
lol , Give up MorningZ, this could go on for ages.
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 25 June 2003 at 10:04am
can you put asp inside the java script?
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 25 June 2003 at 11:29am

ASP script/code/whatever-you-wish-to-call-it runs on the server......

Now whatever it does, talk to a database, manipulate a local file, add 1+1, grab the server time, count to 1000 and do the hokey pokey......  whatever it does... the end result is HTML sent to the client (the computer/browser/human) on the other side of the connection who made the request....   once it delivers the HTML, the web server and client are through talking..... 

Now while you can have ASP "used in Javascript", be aware that the only time it'll do anything is when the page is rendered..

so...

in "test.asp" you have, and this is just a huge super slimmed down example:

<script language="javascript">
function ShowTime() {
 var CurrentTimeAsString = '<%= Now() %>';
}
</script>

if you "view" that page, you'd see something like:

<script language="javascript">
function ShowTime() {
 var CurrentTimeAsString = '6/25/2003 1:18:58 PM';
}
</script>

and at this point, ASP has done its job, page is rendered and delivered to the client, it no longer has a need to comminicate with the client, so the connection is severed

and this doesn't just go for ASP, it goes for PHP, and CF, and any other server-side language

Javascript on the other hand DOES run "real time" on the client.. so it has the ability to constantly update the page with something like, say, a clock....... so thats where the scripts on Dynamic Drive come in.... all that is pulling the time from the client and is in the realm of what it has access to (locally on the client's browser), it has abolutely zero access to the server at this post

Now this isn't saying that one couldn't write some code that "starts" from the "Now()" provided by the server, and then every second increments that initial time given by the server and constantly updates the page, but understand that the time will be off more and more as the javascript takes time to run

Contribute to the working anarchy we fondly call the Internet
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 25 June 2003 at 3:27pm
i see what you're talking about... the asp script takes time to run. and then the javascript takes time to run so by then you have a clock off by about 2 seconds...
Back to Top
 Post Reply Post Reply Page  <123

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.