Jump to content

marky-b

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

marky-b's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. ugh.. i cant believe i missed that stupid $ for the array index. busch league. Thanks for your help with my problem and the code cleanup!
  2. Is there a better way to go about doing this: I'm looking to create a array with the elements being every minute from a classStartTime to an classEndTime (stored as strings). here's what i have so far: $dateFormat = "Y-m-d H:i:s"; $now = date($dateFormat); $today = date("Y-m-d"); $year = date("Y"); $month = date("m"); $date = date("d"); $classStartTime = $today . " 18:00:00"; $classEndTime = $today . " 20:45:00"; $curTime = $classStartTime; $dt = strtotime($curTime); $i = 0; while ( $dt > strtotime($classEndTime) ) { $timeArray[i] = $curTime; //add incrementing time string to array $dt = strtotime($curTime); //convert incrementing time string to DateTime $dt = $dt + 60; //add 1 minute to DateTime (60 seconds) $curTime = date($dateFormat,$dt); //convert back to string $i++; //increment index } soo, the page either times out or doesn't even load. i've even converted the loop to "where ( i < 10 )..." and it does the same as above. is there an easier way to increment a DateTime by minute, convert to a string, and then store in an array? FYI, i'm working with PHP 5.2.9 -mark
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.