Jump to content

Fatal error: Call to a member function stamp() on


Recommended Posts

Hello all,

 

I am a newbie that knows just enough to break things.  My site is currently throwing an error.  With this error, I am thinking it may be related to my hosting providers version of PHP or that they are running PHP as CGI (Dreamhost).  Any help is much appreciated.

 

Error:

Fatal error: Call to a member function stamp() on a non-object ...

 

Code:

function adddays($interval,$mm,$dd,$yy,$hh=0,$min=0,$sec=0){

 

ERROR LINE-----> return $that->stamp($mm,($dd+$interval),$yy,$hh,$min,$sec);

Thanks for the response.  Here is more...

 

class fptime{

function fptime(){

return 1;

}

 

function mytime($stamp="",$format="m/d/Y"){

return date( $format,($stamp ? $stamp : time()) );

}

 

function stamp($mm,$dd,$yy,$hh=0,$min=0,$sec=0){

return mktime($hh,$min,$sec,$mm,$dd,$yy);

}

 

function subhours($interval,$mm,$dd,$yy,$hh,$m,$s){

return $that->stamp( $mm,$dd,$yy,($hh-$interval),$m,$s );

}

 

function addhours($interval,$mm,$dd,$yy,$hh,$m,$s){

return $that->stamp( $mm,$dd,$yy,($hh+$interval),$m,$s );

}

 

function subdays($interval,$mm,$dd,$yy){

return $that->stamp($mm,($dd-$interval),$yy);

}

 

function adddays($interval,$mm,$dd,$yy,$hh=0,$min=0,$sec=0){

return $that->stamp($mm,($dd+$interval),$yy,$hh,$min,$sec);

}

 

function submonths($interval,$mm,$dd,$yy){

return $that->stamp( ($mm-$interval),$dd,$yy );

}

 

function addmonths($interval,$mm,$dd,$yy){

return $that->stamp( ($mm+$interval),$dd,$yy );

}

 

function subyears($interval,$mm,$dd,$yy){

return $that->stamp( $mm,$dd,($yy-$interval) );

}

 

function addyears($interval,$mm,$dd,$yy){

return $that->stamp( $mm,$dd,($yy+$interval) );

}

 

function DateDiff ($interval, $date1,$date2) {

// get the number of seconds between the two dates

$timedifference =  $date2 - $date1;

switch ($interval) {

case "w":

$retval = $timedifference/604800;

$retval = floor($retval);

break;

case "d":

$retval = $timedifference/86400;

$retval = floor($retval);

break;

case "h":

$retval = $timedifference/3600;

$retval = floor($retval);

break;

case "n":

$retval = $timedifference/60;

$retval = floor($retval);

break;

case "s":

$retval  = floor($timedifference);

break;

}

return $retval;

}

 

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.