Okay, I have been working on this a bit and have come up with the following to test what I am trying to do. My question is in regard to Code in Red, but I copied all of it in so you will know what the whole page is currently doing.
My specific question is in regard to these two lines:
$joindate = "10, 27, 2002";
$start = mktime( 0, 0, 0, $joindate );
The $joindate will eventually be a value from a MYSQL table field (and is currently exactly as it appears in the line above). However, currently the timestamp created by those two lines of code does not come out the same as the timestamp that is hardcoded in this line:
$check2 = mktime (0, 0, 0, 10, 27, 2002);
In fact, the code appears to be spitting out whatever it feels like spitting out. I have verified both $checkX timestamps to be correct so the error is in the way that the value of $joindate is passed to the mktime function.
Help?
<?php
$date_array = getdate(); // no argument passed so today's date will be used
foreach ( $date_array as $key => $val )
{
print "$key = $val<br>";
}
print "Today's date: $date_array[mday]/$date_array[mon]/$date_array[year]<p>";
echo "<hr><br><br>";
print "$date_array[0]";
echo "<br>";
$joindate = "10, 27, 2002";
$start = mktime(0, 0, 0, $joindate );
echo $start;
echo "<br>";
$end = 0;
$end = (($date_array[0] - $start) / 2627424);
// echo (int)$end;
echo $end;
echo "<hr><br><br>";
echo "Time stamp verification: Nov. 1, 2002 at 0:00.00<br>";
$check1 = mktime (0, 0, 0, 11, 1, 2002);
echo $check1;
echo "<br>";
echo "Time stamp verification: Oct. 24, 2002 at 0:00.00<br>";
$check2 = mktime (0, 0, 0, 10, 27, 2002);
echo $check2;
?>