Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

countdown - time showing 2

Status
Not open for further replies.
I looked at your site on 4-30-01 at 11:53 AM EST and here's what it showed:

Estimated Completion: May 1, 2001 2:00:00 p.m.
Time remaining: 1 day6 hours, 5 minutes, 22 seconds.

Notice that you are missing a space after "days".

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Javascript is run at client side, so no matter where your local computer time is set...it should be according to their time and their preference.

Thanks,
Hui Emagine Solutions, Inc.
 
tsdragon: thanks for pointing out that typo :)
---
htin11: Hm, so there isn't really a js countdown that would show the actual time zone of the page at a specified location (time zone).
:(
======

I appreciate your replys, thank you.
code404
 
Hi

y2k = new Date("May 1 2001 14:00:00 PST");

but since you told it what time zone you are in...it's correct...so right now it's 4:33 PM in EST

and it says this:
Site updating for May 2001 in progress.
Estimated Completion: May 1, 2001 2:00:00 p.m.
Time remaining: 1 day1 hour26 minutes, 29 seconds

which is like 6 pm EST

so i think ca is 4 hours or 3 hours behind us?

so i would say this script is working..

Thanks,
Hui
Emagine Solutions, Inc.
 
Hi code404,

actually, you can specify the time zone by using toGMTString(), here is the example showing the GreenwichMeanTime

<script>
aDate = new Date()
document.write(aDate.toGMTString())
</script>

hope this helps, Chiu Chan
WebMaster & Software Engineer
emagine solutions, inc
cchan@emagine-solutions.com
 
Hi gang!

Well, darn... I went running off to find another alternative. So now I have a Time zone applet running. Is it working???

If it is working,
then I need to decide which one to use.

Pepperpepsi:
I'm thrilled that the javascript is working!!!!
Would your suggestion work this way?
y2k = new Date(&quot;May 1 2001 14:00:00 GMT -7:00&quot;);

Thanking all for your kind help,
code404
 
I just clicked the link directly above. Got a 404 error and was redirected to custom_404.html. Oops.
Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
tsdragon!!!

oh sorry for the code404 ... gee thanks anyway.
I do appreciate you getting back to me to help.

Completion time for the updating was changed to May 1, 2001 1:00 am GMT-700
I managed to complete ahead of schedule 11:30 pm :)

I decided to change back to the original countdown script.
Running it live was just a few hours (3) away from completion time so, I didn't have to correct the &quot;days typo&quot; ...but I've been looking at the code and don't know exactly where to correct it. I do plan to use the script again.

<!-- Begin
function getTime() {
now = new Date();
y2k = new Date(&quot;May 1 2001 01:00:00 GMT-700&quot;);
days = (y2k - now) / 1000 / 60 / 60 / 24;
daysRound = Math.floor(days);
hours = (y2k - now) / 1000 / 60 / 60 - (24 * daysRound);
hoursRound = Math.floor(hours);
minutes = (y2k - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
minutesRound = Math.floor(minutes);
seconds = (y2k - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
secondsRound = Math.round(seconds);
sec = (secondsRound == 1) ? &quot; second.&quot; : &quot; seconds.&quot;;
min = (minutesRound == 1) ? &quot; minute&quot; : &quot; minutes, &quot;;
hr = (hoursRound == 1) ? &quot; hour&quot; : &quot; hours, &quot;;
dy = (daysRound == 1) ? &quot; day&quot; : &quot; days, &quot;
document.timeForm.input1.value = &quot;Time remaining: &quot; + daysRound + dy + hoursRound + hr + minutesRound + min + secondsRound + sec;
newtime = window.setTimeout(&quot;getTime();&quot;, 1000);
}
// End -->

Thanks again!!
code404
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top