$offset = "<script>document.write(new Date().getTimezoneOffset().toString());</script>";
Session::set("offset", $offset);
$offset=Session::get("offset");
echo intval($offset);
I am trying to convert timezone to integer. intval output is always 0.