Jump to content

[SOLVED] mktime() expects parameter 6 to be long


Recommended Posts

 

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

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));

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.