Hopefully someone can tell me whats going on with this little debugging script.
<?PHP
// function generates the list of times for
function generateTimes($date) {
$currentDate = $date;
echo "RECEIVED CURRENT DATE: " . date("m/d/Y g:iA", $currentDate) . "<br /><br />";
for($i = 0; $i < 48; $i++) {
echo date("g:iA", $currentDate) . "<br />";
$currentDate = mktime(date("g", $currentDate),date("i", $currentDate)+30,0,date("m", $currentDate),date("d", $currentDate),date("Y", $currentDate)); // 30 minutes
}
}
if (isset($_POST['generate_date'])) {
echo "Date Stamp: " . strtotime($_POST['date']) . "<br /><br />";
echo "The time you entered: " . date("r", strtotime($_POST['date'])) . "<br /><br />";
generateTimes($_POST['date']);
}
echo "<form method=post action='timestampgen.php'>";
echo "<input type=text name='date' />";
echo "<input type=submit name='generate_date' value='Generate Time Stamp' />";
echo "</form><br /><br />";
?>
I submit a date such as 10/1/10 12:00AM and I want it to generate 30 minute intervals of time.. but it doesnt seem to be working, and I think it is related to my mktime parameters
I've been working on something all day, so this is probably me going crazy.