Author |
Topic |
|
CooLGiL
Junior Member
126 Posts |
Posted - 04 March 2002 : 16:57:58
|
im from israel and i made a program that use the clock: lets say: dim realtime realtime=time tha problem is that im hosting my files on american server and the time there is other then here ! so its massing my program! is there any way to make that the clock will be like the windows clock?
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 04 March 2002 : 18:26:56
|
Can't you just make a time adjustment for the time zone you are in compared to the time zone of your host?
Nikkol |
|
|
CooLGiL
Junior Member
126 Posts |
Posted - 05 March 2002 : 00:31:05
|
man ididnt ardenstand wht you said! im giving the code: <br> <% dim realtime,timea,timeb,timec,timed,y realtime=time() timea=timevalue("07:00") timeb=timevalue("07:45") timec=timevalue("08:00") timed=timevalue("13:00") timee=timevalue("14:00") timef=timevalue("16:00") timeg=timevalue("19:00") timeh=timevalue("19:02") timei=timevalue("20:00") timej=timevalue("20:30") timek=timevalue("20:32") timel=timevalue("23:00") timem=timevalue("23:02")
if realtime >= timea and realtime < timeb then y = "קום ותתכונן לבית ספר!!"
elseif realtime >= timeb and realtime < timec then y = "לך לבית ספר"
elseif realtime >= timec and realtime < timed then y = "אתב אמור להיות בבית ספר!"
elseif realtime >= timed and realtime < timee then y = "טוב לראות אותך חוזר מבית ספר!"
elseif realtime >= timee and realtime < timef then y = "תכין שיעורים"
elseif realtime >= timef and realtime < timeg then y = "לצאת לשחק כדורגל בשכונה"
elseif realtime >= timeg and realtime < timeh then y = "תחזור הביתה!"
elseif realtime >= timeh and realtime < timei then y = "תסדר ילקוט למחר"
elseif realtime >= timei and realtime < timej then y = "לך להתקלח"
elseif realtime >= timei and realtime < timej then y = "צא מהמקלחת"
elseif realtime >= timej and realtime < timek then y = "תתכונן לשינה"
elseif realtime >= timek and realtime < timel then y = "לילה טוב:)"
elseif realtime >= timem then y = "אתה אמור להיות ישן עכשיו"
else y = "error" end if %> <%=y%> <br> ###### dont manthan the hebrew think like its english ;))
|
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 05 March 2002 : 04:10:38
|
For instance, there is a 7 hour difference between you and me. So, it's 11am where you are and 4am where I am. So, if your host is on the east coast of the U.S, you would just subtract 7 from the time values you are using.
Nikkol |
|
|
CooLGiL
Junior Member
126 Posts |
Posted - 05 March 2002 : 06:58:21
|
mm..... why cant i set the clock to be like the viewr clock?
|
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 05 March 2002 : 07:13:50
|
What view clock? You mean on your PC? The Time function you are using pulls the time from the server that is running your ASP pages, i.e. your host's server. There's a way to get the client's time on their PC, but I don't know how to do that.
Nikkol |
|
|
CooLGiL
Junior Member
126 Posts |
Posted - 05 March 2002 : 07:27:29
|
quote:
What view clock? You mean on your PC? The Time function you are using pulls the time from the server that is running your ASP pages, i.e. your host's server. There's a way to get the client's time on their PC, but I don't know how to do that.
Nikkol
plz serch for me :( its for tommrow!! my work.....(in school...)
|
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 05 March 2002 : 07:39:29
|
CoolGil,
Here you have a Javascript example from O'Reilly's Javascript - The Definitive Guide. It shows you how to display a self updating clock at the status line in your browser.
<!-- This example is from JavaScript: The Definitive Guide, 3rd Edition. --> <!-- That book and this example were Written by David Flanagan. --> <!-- They are Copyright (c) 1996, 1997, 1998 O'Reilly & Associates. --> <!-- This example is provided WITHOUT WARRANTY either expressed or implied.--> <!-- You may study, use, modify, and distribute it for any purpose, --> <!-- as long as this notice is retained. -->
<HTML> <HEAD> <SCRIPT> // This function displays the time in the status line. // Invoke it once to activate the clock; it will call itself from then on. function display_time_in_status_line() { var d = new Date(); // Get current time. var h = d.getHours(); // Extract hours: 0 to 23. var m = d.getMinutes(); // Extract minutes: 0 to 59. var ampm = (h >= 12)?"PM":"AM"; // Is it am or pm? if (h > 12) h -= 12; // Convert 24-hour format to 12-hour. if (h == 0) h = 12; // Convert 0 o'clock to midnight. if (m < 10) m = "0" + m; // Convert 0 minutes to 00 minutes, etc. var t = h + ':' + m + ' ' + ampm; // Put it all together.
defaultStatus = t; // Display it in the status line.
// Arrange to do it all again in 1 minute. setTimeout("display_time_in_status_line()", 60000); // 60000 ms is 1 minute. } </SCRIPT> </HEAD> <!-- Don't bother starting the clock till everything is loaded. The -- status line will be busy with other messages during loading, anyway. --> <BODY onLoad="display_time_in_status_line();"> <!-- The HTML document contents go here. -->
<!-- O'Reilly Footer Begins Here -->
<center> </center>
<!-- O'Reilly Footer Ends Here -->
</BODY> </HTML>
This shows you how to set a clock in the browser using the time from the user's PC. You can change it to suit your needs. Don't forget to respect the copyright notice if you plan to use it...
------------------------------------------------- Installation Guide | Do's and Dont's | MODs |
|
|
CooLGiL
Junior Member
126 Posts |
Posted - 05 March 2002 : 07:52:38
|
im not planing use that... i need a code in asp that show the user time
|
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 05 March 2002 : 07:57:56
|
quote:
im not planing use that... i need a code in asp that show the user time
It should be clear to you from what Nikkol wrote that there is no way you can use the client's clock using ASP. If you want to use it, use it, if not, don't use it.
------------------------------------------------- Installation Guide | Do's and Dont's | MODs
Edited by - ruirib on 05 March 2002 08:02:04 |
|
|
CooLGiL
Junior Member
126 Posts |
Posted - 05 March 2002 : 08:03:38
|
quote:
quote:
im not planing use that... i need a code in asp that show the user time
It should be clear to you from what Nikkol wrote that there is no way you can use the client's clock using ASP. If you want to use it, use it, if don't, don't use it.
------------------------------------------------- Installation Guide | Do's and Dont's | MODs
Edited by - ruirib on 05 March 2002 08:00:55
there is way! now can you tell me hoe i get the client ip? lets say thet: dim ip
ip = the conf ip you shuld tell me
<%=ip%>
##
now i need it for the clock i will try using the ip code for the clock :)
|
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 05 March 2002 : 08:04:41
|
And besides, didn't I tell you last time that I was gonna make you think harder? You need to be doing your own homework!!
Nikkol |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 05 March 2002 : 08:06:09
|
quote:
And besides, didn't I tell you last time that I was gonna make you think harder? You need to be doing your own homework!!
Nikkol
I'm with you all the way Nikkol.
------------------------------------------------- Installation Guide | Do's and Dont's | MODs |
|
|
CooLGiL
Junior Member
126 Posts |
Posted - 05 March 2002 : 08:06:17
|
quote:
And besides, didn't I tell you last time that I was gonna make you think harder? You need to be doing your own homework!!
Nikkol
im trying!!!!! give the code that the user can see is oen ip when he get in the site and i will make the clock of that
|
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 05 March 2002 : 08:09:03
|
quote:
there is way! now can you tell me hoe i get the client ip? lets say
ASP is a server-side script. You might be able to mix client-side and server-side scripts somehow, but I just don't have the time right now to figure it out. (No pun intended )
Nikkol |
|
|
CooLGiL
Junior Member
126 Posts |
Posted - 05 March 2002 : 08:10:23
|
quote:
quote:
there is way! now can you tell me hoe i get the client ip? lets say
ASP is a server-side script. You might be able to mix client-side and server-side scripts somehow, but I just don't have the time right now to figure it out. (No pun intended )
Nikkol
danm
|
|
|
|
Topic |
|