Hello everyone.
I have a very dumb question for you. I'm trying to convert a string that has been input from a form to a date in the format of, say, an Access database. Every time I do, I get errors that keep getting stranger and stranger. I've included the piece of code and the result below. Thank you for your help!
-Darren
-----------CODE--------------
echo $stadate;
echo "<BR>";
echo $enddate;
echo "<BR>";
echo gettype($stadate);
echo gettype($enddate);
echo "<BR>";
echo "<BR>";
$stadate=strtotime($stadate);
$enddate=strtotime($enddate);
$stadate=date('Ymd H:i','$stadate');
$enddate=date('Ymd H:i','$enddate');
echo $stadate;
echo "<BR>";
echo $enddate;
echo "<BR>";
echo gettype($stadate);
echo gettype($enddate);
------------RESULT-------------------
2147483647
2147483647
integerinteger
Warning: date() expects parameter 2 to be long, string given in D:\dbtsite\oncall2.php on line 70
Warning: date() expects parameter 2 to be long, string given in D:\dbtsite\oncall2.php on line 71
booleanboolean
I told you it was strange............