Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Anyone know a Upcounter, Timer?
07-07-2006, 11:54 PM #1
- Join Date
- Jul 2006
- Thanked 0 Times in 0 Posts
Anyone know a Upcounter, Timer?
Well, been looking for a script that can add x value from x sum from x period every second (or specified time. For example,
Every second this "timer" shall add the number 1 to the start of 50 sum. Until tomorrow where the total sum would then be 50+(60*60*24), Seconds. Of course the time is steady, like a fixed date and the counting is running every second even though the viewer isnt looking at it. If he leaves for 1 min and comes back the script would then added 60 seconds if it added 1 nr every second.
Kind of like, countup script, but this counts day and hours. I just want like seconds, or more precisly dollar and cent. (http://www.dynamicdrive.com/dynamici...countingup.htm)
In addition (not necessary) this "timer" would every hour perform x action. Like show a new image every hour though sounds like u would put this separate since it shall not affect the "timer".
Another nice thing would be if that after 12 hours the amount added would be changed by x percentage of the current sum. Like for example, after 12 hours the sum would be 50+(60*60*12), 43250 seconds and then it would add for example 1 % of that sum which would be 432,5 increase every second.
Reason i said, dhtml preferble is because i am gonna use it for a site.
Anyone know of a "timer" like this i would love to know. Appreciate the aid,
07-08-2006, 08:08 AM #2
- Join Date
- Jun 2002
- London, England
- Thanked 2,593 Times in 2,571 Posts
"In addition (not necessary) this "timer" would every hour perform x action. Like show a new image every hour though sounds like u would put this separate since it shall not affect the "timer"."
This is easy.
var now = new Date();
var hh = now.getHours();
returns the hour (0-23).
Then displaythe appropriate image accordingly.