Jump to content

Date Problems - Please help resolve mktime() error


mrpickleman

Recommended Posts

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
Share on other sites

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.