Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 help in clock.....
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

CooLGiL
Junior Member

126 Posts

Posted - 04 March 2002 :  16:57:58  Show Profile  Send CooLGiL an ICQ Message
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  Show Profile
Can't you just make a time adjustment for the time zone you are in compared to the time zone of your host?

Nikkol
Go to Top of Page

CooLGiL
Junior Member

126 Posts

Posted - 05 March 2002 :  00:31:05  Show Profile  Send CooLGiL an ICQ Message
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 ;))

Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 05 March 2002 :  04:10:38  Show Profile
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
Go to Top of Page

CooLGiL
Junior Member

126 Posts

Posted - 05 March 2002 :  06:58:21  Show Profile  Send CooLGiL an ICQ Message
mm..... why cant i set the clock to be like the viewr clock?

Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 05 March 2002 :  07:13:50  Show Profile
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
Go to Top of Page

CooLGiL
Junior Member

126 Posts

Posted - 05 March 2002 :  07:27:29  Show Profile  Send CooLGiL an ICQ Message
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...)

Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 05 March 2002 :  07:39:29  Show Profile  Send ruirib a Yahoo! Message
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
Go to Top of Page

CooLGiL
Junior Member

126 Posts

Posted - 05 March 2002 :  07:52:38  Show Profile  Send CooLGiL an ICQ Message
im not planing use that... i need a code in asp that show the user time

Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 05 March 2002 :  07:57:56  Show Profile  Send ruirib a Yahoo! Message
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
Go to Top of Page

CooLGiL
Junior Member

126 Posts

Posted - 05 March 2002 :  08:03:38  Show Profile  Send CooLGiL an ICQ Message
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 :)

Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 05 March 2002 :  08:04:41  Show Profile
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
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 05 March 2002 :  08:06:09  Show Profile  Send ruirib a Yahoo! Message
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
Go to Top of Page

CooLGiL
Junior Member

126 Posts

Posted - 05 March 2002 :  08:06:17  Show Profile  Send CooLGiL an ICQ Message
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

Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 05 March 2002 :  08:09:03  Show Profile
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
Go to Top of Page

CooLGiL
Junior Member

126 Posts

Posted - 05 March 2002 :  08:10:23  Show Profile  Send CooLGiL an ICQ Message
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

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07