mrpickleman Posted April 9, 2010 Share Posted April 9, 2010 My script is doing my head in, if anyone can help me to see where this has gone wrong, it would be greatly appreciated, I am just a newbie.. thanks I am getting this error Warning: mktime() expects parameter 6 to be long, string given in /home/ourtrad2/public_html/functions.php function ifUpdated ($date) { global $def_updated; $date_day = date ( "d" ); $date_month = date ( "m" ); $date_year = date ( "Y" ); list ( $on_year, $on_month, $on_day ) = split ( '[/.-]', $date ); $first_date = mktime ( 0,0,0,$on_month,$on_day,$on_year ); $second_date = mktime ( 0,0,0,$date_month,$date_day,$date_year ); if ( $second_date > $first_date ) { $days = $second_date - $first_date; } else { $days = $first_date - $second_date; } $current_result = ( $days ) / ( 60 * 60 * 24 ); if ( $current_result <= 5 ) { $updated_listing = "$def_updated"; } else { $updated_listing = ""; } return $updated_listing; } Link to comment https://forums.phpfreaks.com/topic/198090-date-problems-please-help-resolve-mktime-error/ Share on other sites More sharing options...
scvinodkumar Posted April 9, 2010 Share Posted April 9, 2010 what date format you pass to function Link to comment https://forums.phpfreaks.com/topic/198090-date-problems-please-help-resolve-mktime-error/#findComment-1039391 Share on other sites More sharing options...
mrpickleman Posted April 9, 2010 Author Share Posted April 9, 2010 I am not sure how do I find out? Link to comment https://forums.phpfreaks.com/topic/198090-date-problems-please-help-resolve-mktime-error/#findComment-1039399 Share on other sites More sharing options...
scvinodkumar Posted April 9, 2010 Share Posted April 9, 2010 i think you get this error because of missing argument value.... Link to comment https://forums.phpfreaks.com/topic/198090-date-problems-please-help-resolve-mktime-error/#findComment-1039400 Share on other sites More sharing options...
ignace Posted April 9, 2010 Share Posted April 9, 2010 $first_date = mktime ( 0,0,0, intval($on_month), intval($on_day), intval($on_year) ); $second_date = mktime ( 0,0,0, intval($date_month), intval($date_day), intval($date_year) ); Link to comment https://forums.phpfreaks.com/topic/198090-date-problems-please-help-resolve-mktime-error/#findComment-1039413 Share on other sites More sharing options...
mrpickleman Posted April 9, 2010 Author Share Posted April 9, 2010 thanks so much guys Link to comment https://forums.phpfreaks.com/topic/198090-date-problems-please-help-resolve-mktime-error/#findComment-1039426 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.