Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    528
    Thanks
    8
    Thanked 8 Times in 8 Posts

    strtotime problem

    Ok.. here is my code:

    PHP Code:
    $date time();

    if (!isset(
    $t_day)) {

        
    $t_day date('M j, Y',$date);
    }

    print    
    '<h3>Create Tournament</h3>';
    print    
    '<a href=?module=tournaments&mode=calendar>Upcoming Tournaments</a> | <a href=?module=tournaments&mode=guide>Tournament Guide</a> | <b>Create Tournament</b>';
    print    
    '<br><br>';

    /* START DAY SELECTION */

    $selectbox2.=    '<option value="'.$t_day.'">'.$t_day.'</option>';

    $getdate date("M j, Y",$date); 
    for(
    $count 1$count <= 60$count++ ) {

        
    $selectbox2.=    '<option value="'.$getdate.'">'.$getdate.'</option>';

        
    $newdate strtotime($getdate ' + 1 day'); 
        
    $getdate date('M j, Y'$newdate); 
        
    }
    /* END DAY SELECTION */

    /* START TIME SELECTION */

    $check1 $t_day;
    $check2 strtotime($t_day);
    $check2 date("h:ia",$check2);

    while (
    $check1 == $t_day) {

        
    $getdate1 date("h:ia",$check2); 
        
    $getdate2 date("H:i",$check2);
        
        
    $selectbox3.=     '<option value="'.$getdate2.'">'.$getdate1.'</option>';
        
        
    $check2 strtotime($getdate1 ' + 15 minutes');
        
    $check1 date('M j, Y'$check2);

    }
    /* END TIME SELECTION */


    print 'Select Date: <select name=t_day onChange="if(this.options[this.selectedIndex].value) window.location=\'?module=tournaments&mode=create&t_day=\'+this.options[this.selectedIndex].value;">'.$selectbox2.'</select><p>';
    print 
    'Select Time: <select name=time>'.$selectbox3.'</select>'
    For some reason, this is outputting in the 2nd select box from 11am to 11.45pm instead of 12.00am to 11.45pm. I'm not quite sure why

    Any idea's?

    Thanks in advance!

    Taylor.

  • #2
    Regular Coder
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    528
    Thanks
    8
    Thanked 8 Times in 8 Posts
    SORRY!

    Just found problem... I was setting date of $check2 twice.

    Unfortunately, being in Melbourne, Australia and the middle of winter I don't have the heat as an excuse like NancyJ.

    LOL


  • #3
    New Coder
    Join Date
    Jul 2005
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    *envious*..

    It's too hot here.. I can't think straight


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •