By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,382 Members | 1,631 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,382 IT Pros & Developers. It's quick & easy.

Displaying Time at 10-minute Intervals

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Rick Barr wrote:
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:
This is best done on the server, not with client side scripting.
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.


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
Jul 20 '05 #2

P: n/a
Rick Barr wrote on 28 jun 2003 in comp.lang.javascript:
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


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)
Jul 20 '05 #3

P: n/a
David Dorward wrote on 28 jun 2003 in comp.lang.javascript:
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:


This is best done on the server, not with client side scripting.


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)
Jul 20 '05 #4

P: n/a
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!
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.