473,406 Members | 2,369 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Displaying Time at 10-minute Intervals

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
4 2605
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: yawnmoth | last post by:
i'm trying to display text while a page is loading using a method similar to the following: <? ob_end_flush(); echo 'AAA<br>'; flush(); sleep(10); echo 'BBB'; ?>
5
by: Mystery | last post by:
Can anyone point me to a script that will allow me to list x number of records per page and give me a page selector and information like the one in the subject header? Thanks.
2
by: partridge | last post by:
I'm sure it's not mozilla's fault but I'm at a loss here. I'm loading the following XML data into a page using http_request: <?xml version="1.0" encoding="iso-8859-1"?> <forum> <message...
2
by: VM | last post by:
When I display data to a Windows datagrid I usually fill the underlying table (in another class) and then, once it contains all the data, I attach it to the grid. But there are some processes that...
2
by: marvin | last post by:
Hi, I am trying to display images in a repeater from a SQL database and do some transformations on the image prior to displaying them (such as thumbnail with a shadow). The problem is I can't...
5
by: nbohana | last post by:
I have a windows form with several fields. One of the fields is a date. I use DateTimePicker to enter and format the date. In my SQL table the date si stored as follows "01/10/2005" and this is...
19
by: Melvin G. Sheppers | last post by:
I want to display the time in a particular timezone (US Central) regardless where the computer is located. I have written the script below which displays the time in the Eastern, Central, Mountain,...
1
by: pgrayove | last post by:
I'm a first time poster and I would really appreciate any help. I'm working with a MySQL database using a Perl script to access the data and display as a web page. I'm stuck with one part. The...
0
by: Steve | last post by:
The approach in this thread looks wrong to me considering your example. Your example shows you have random time periods between 6AM and 6 PM for appointments. Appointment 1 is 1-1/2 hour,...
4
by: fts2012 | last post by:
Hi all, I set the ToolTips when the solution is running. as follows: ToolTip1.SetToolTip(Me.Label1, "nothing") ToolTip1.AutomaticDelay = 10 ToolTip1.AutoPopDelay = 5000 ToolTip1.ShowAlways =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.