zc1 Posted January 19, 2008 Share Posted January 19, 2008 Hi, I have found a script on the net which I am trying to fix up, and it nearly done, but for a few things and the below 3 errors I am getting in the same file. I was wondering if some one could help. I have looked at mktime on php.net and could really see anything like the below code. Warning: mktime() expects parameter 6 to be long, string given in /home/USERNAME/public_html/calendar/event.php on line 51 Warning: mktime() expects parameter 6 to be long, string given in /home/USERNAME/public_html/calendar/event.php on line 56 Warning: mktime() expects parameter 6 to be long, string given in /home/USERNAME/public_html/calendar/event.php on line 61 I have put the line numbers in the below code 50 $split = explode("-",$Date); 51 $showDate = date("l F jS, Y", mktime(0,0,0,$split[1],$split[2],$split[0])); 52 53 // format the displayed time 54 if ($CeSS == 1) { 55 $split2 = explode(":",$CeST); 56 $showStart = date("g:i A", mktime($split2[0],$split2[1],0,$split[1],$split[2],$split[0])); 57 } 58 59 if ($CeSh == 1) { 60 $split2 = explode(":",$CeSt); 61 $showEnd = date("g:i A", mktime($split2[0],$split2[1],0,$split[1],$split[2],$split[0])); 62 } 63 64 if ($showStart) { 65 $showTime = $showStart; 66 if ($showEnd) { 67 $showTime .= " - $showEnd"; 68 } 69 } Regards, Garry Link to comment https://forums.phpfreaks.com/topic/86754-solved-mktime-expects-parameter-6-to-be-long/ Share on other sites More sharing options...
Aureole Posted January 19, 2008 Share Posted January 19, 2008 No doubt your 6th paramter is in some sort of short date format and mktime wants it in a long format, unfortunately I don't really know too much about all the date and time functions of PHP, sorry. Link to comment https://forums.phpfreaks.com/topic/86754-solved-mktime-expects-parameter-6-to-be-long/#findComment-443399 Share on other sites More sharing options...
roopurt18 Posted January 19, 2008 Share Posted January 19, 2008 Make sure $Date contains valid data first and that $split[0] contains the value you expect. If that fails, maybe try: 50 //$split = explode("-",$Date); 51 $showDate = date("l F jS, Y", strtotime($Date)); Link to comment https://forums.phpfreaks.com/topic/86754-solved-mktime-expects-parameter-6-to-be-long/#findComment-443406 Share on other sites More sharing options...
zc1 Posted January 19, 2008 Author Share Posted January 19, 2008 Hi, Thanks for your replies However I have fixed it, the script was not defining $Date Link to comment https://forums.phpfreaks.com/topic/86754-solved-mktime-expects-parameter-6-to-be-long/#findComment-443412 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.