Forum Moderators: coopster

Message Too Old, No Replies

Incrementing Time.....

Using for loop

         

woldie

12:22 pm on Aug 26, 2004 (gmt 0)

10+ Year Member



Hi,

I'm not quite sure how to go about doing this, just need some assitance, thanks.

What I would like to achieve is to increment time by every 15 mins starting from 10:00 till 17:00. Obviously I'm going to use a for loop so that it increments every 15 mins.

Now I'm not quite sure whether I need to use a timestamp as a start time and end time, because I need to insert the time selected into a database.

Thanks in advance.

Woldie.

woldie

2:51 pm on Aug 26, 2004 (gmt 0)

10+ Year Member



Another thing, I meant to add, is that, the purpose of trying to achieve this, is that I am creating a online booking system.

Essentially what you have is a calendar and once you click on the date it passes the date. Then, for that date you can select which time you want to book a assessment. So this is why I would like to increment the time from 10:00 to 17:00 because thats the slots available.

Hope this helps

I'm currently looking at the mktime() function and see if I can get any ideas.

Thanks

woldie

3:59 pm on Aug 26, 2004 (gmt 0)

10+ Year Member



I've managed to code it....

<?
for($i=32400;$i<=57600;$i+=900)
echo date("H:i",$i)."<BR>";

?>

Thanks