function convertTZ($tz) making apache crash

Discussion in 'PHP' started by afonseca, Nov 26, 2006.

  1. #1
    Hi all!

    I have a situation with a function that returns timezone.
    ----------------------------------------------
    function convertTZ($tz)
    {
    // convert to UTC
    if ($this->tz->getOffset($this) > 0) {
    $this->subtractSeconds(intval(abs($this->tz->getOffset($this)) / 1000));
    } else {
    $this->addSeconds(intval(abs($this->tz->getOffset($this)) / 1000));
    }
    // convert UTC to new timezone
    if ($tz->getOffset($this) > 0) {
    $this->addSeconds(intval(abs($tz->getOffset($this)) / 1000));
    } else {
    $this->subtractSeconds(intval(abs($tz->getOffset($this)) / 1000));
    }
    $this->tz = $tz;
    }

    ----------------------------------------------
    This functions is making apache crash--->[notice] Parent: child process exited with status 3221225477 -- Restarting.

    Aparently the solution is to hardwire the function to return my desired timezone!

    Does anyone knows how can I set it to Europe/london time!

    Thanks in advance.
    António
     
    afonseca, Nov 26, 2006 IP
  2. lbalance

    lbalance Peon

    Messages:
    381
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #2
    are you just trying to offset the server date on your website to show it in your time zone?

    if so, just do something like this:
    $offsetHours = 5; 
    echo date("H:i:s",time()+($offsetHours*3600));
    PHP:
    if not, please explain a little more please.
     
    lbalance, Nov 26, 2006 IP