Hello Andy,
Tuesday, April 6, 2004, 2:18:45 PM, you wrote:
AB> i have the function i made:
AB> function CreateDate($day, $month, $year) {
AB> if(!empty($day) && !empty($month) && !empty($year)){
AB> //convert $day, $month, and $year into a valid timestamp
AB> $time= strtotime($day, mktime(0,0,0,$month,1,$year));
AB> $time=date("YmdHis", $time);
AB> return $time; }
AB> else {
AB> return false; }}
?>>
AB> my output ends up being Monday January 18, 2038 no matter what i
AB> try to use in the forms.....
Your function doesn't seem to make any sense to be honest - you're
passing in the $day value to strtotime (a function that ideally
requires English language date formats) and then asking it to
calculate a timestamp based off the offset of the month and year.
So ultimately you're feeding strtotime = 10, timestamp
which means it's going to try and calculate the difference between 10
and the given timestamp (which is going to be a lot!)
What exactly is this function *supposed* to do?
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php