Connecting Tech Pros Worldwide Forums | Help | Site Map

Displaying Time at 10-minute Intervals

Rick Barr
Guest
 
Posts: n/a
#1: Jul 20 '05
I'm trying to build a tee-time reservation page, and want to display
all the available tee times on one page for a particular date. I
simply want to list the times out in 10-minute intervals, like:

8:30am
8:40am
8:50am

Additionally, I want to be able to parse out the times that already
have entries in my SQL database, but for now I'll settle for just
getting the times listed.

Thanks,

-Rick

David Dorward
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Displaying Time at 10-minute Intervals


Rick Barr wrote:
[color=blue]
> I'm trying to build a tee-time reservation page, and want to display
> all the available tee times on one page for a particular date. I
> simply want to list the times out in 10-minute intervals, like:[/color]

This is best done on the server, not with client side scripting.
[color=blue]
> Additionally, I want to be able to parse out the times that already
> have entries in my SQL database, but for now I'll settle for just
> getting the times listed.[/color]

This must be done on the server, so you might as well save yourself the
effort of mucking around with client side scripting only to have to start
again.

--
David Dorward http://david.us-lot.org/
Redesign in progress: http://stone.thecoreworlds.net/
Microsoft announces IE is dead (so upgrade):
http://minutillo.com/steve/weblog/20...ces-ie-is-dead
Evertjan.
Guest
 
Posts: n/a
#3: Jul 20 '05

re: Displaying Time at 10-minute Intervals


Rick Barr wrote on 28 jun 2003 in comp.lang.javascript:
[color=blue]
> I'm trying to build a tee-time reservation page, and want to display
> all the available tee times on one page for a particular date. I
> simply want to list the times out in 10-minute intervals, like:
>
> 8:30am
> 8:40am
> 8:50am[/color]

Besides the "american" way of time being crasy,
and Noon never being am nor pm:


<table border=1>
<script>
end=false
h=8
m=3
ap="0am"
td1="<tr><td style='text-align:right;width:110px;'>"
dd=":"
td2="</td><td style='text-align:right;width:100px;'>Free</td></tr>"

while (!end){
document.write(td1+h+dd+m+ap+td2)
m++
if(m==6){
m=0
h++
if(h==12)ap="0pm"
if(h==13)h=1
}
if(ap=="0pm"&&h==9&&m==1)end=true
}
</script>
</table>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Evertjan.
Guest
 
Posts: n/a
#4: Jul 20 '05

re: Displaying Time at 10-minute Intervals


David Dorward wrote on 28 jun 2003 in comp.lang.javascript:
[color=blue][color=green]
>> I'm trying to build a tee-time reservation page, and want to display
>> all the available tee times on one page for a particular date. I
>> simply want to list the times out in 10-minute intervals, like:[/color]
>
> This is best done on the server, not with client side scripting.
>[/color]

Also on a server it can perfectly well be done with javascript.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Rick Barr
Guest
 
Posts: n/a
#5: Jul 20 '05

re: Displaying Time at 10-minute Intervals


Thanks VERY much for this. It makes sense, how it works, and I did go
ahead and make it a server-side script. Now I'll just need to work on
filtering out the times where a record already exists.

-Rick


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Closed Thread