Nasıl PHP dilimi farkı hesaplamayı ele?

0 Cevap php

Ben kullanıcının yerel saati Bu hesaplama aşağıda yöntemi bazen çalışmadığını söyledi ediliyorum. PHP bunu yapmanın en iyi yolu nedir? Ne yaparsınız?

public function getTimeOffset ($time) {
    $this->_cacheTimeOffset();  
    if ($this->timeOffsetExecuted) {
        $d = date("O");
        $neg = 1;

        if (substr($d, 0, 1) == "-") {
            $neg = -1;
            $d = substr($d, 1);
        }

        $h = substr($d, 0, 2)*3600;
        $m = substr($d, 2)*60;

        return $time + ($neg * ($h + $m) * -1) + (($this->timeOffset + $this->getDstInUse()) * 3600);
    }
    return $time;
}

0 Cevap