<?php
$tz_string = 'Europe/Paris';
$timezone_utc = timezone_open('UTC');
$timezone = timezone_open($tz_string);
//$lasttimestamp = time();
//$lasttimestamp = 1743296400;
//$lasttimestamp = 1729990800;
//$lasttimestamp = 4141328400;
$lasttimestamp = 4160077200;
$lasttimestamp2 = '' . $lasttimestamp;
$to_min = strtr($lasttimestamp2, array('-2147483648' => '-2147483647', '-2147483647' => '-2147483647', '2147483647' => '2147483646'));
$to_min = (int) $to_min;
$to_min = '' . $to_min;
$to_min = strtr($to_min, array('-2147483648' => '2147483647'));
$to_min = (int) $to_min;
$from_max = 2147483647;
$to_min2 = 2147483647;
if($to_min > 2147483647 || -2147483648 > $to_min) {
$from_max = '2147483648';
$from_max = (int) $from_max;
} elseif($to_min < 2147483647) {
$to_min2 = 2147483646;
}
if($from_max > $to_min2) {
$lasttimestamp = (int) $lasttimestamp;
$timestampsec = '+0 sec';
$date1 = date_create('1970-01-01 00:00:00', $timezone_utc);
$date2 = date_modify($date1, $timestampsec);
$obj_rt = is_object($date2);
$key3 = 1;
$key4 = 1;
if($obj_rt) {
$transitions = timezone_transitions_get($timezone, $lasttimestamp);
$count = count($transitions);
if(2 > $count) {
$transitions2 = timezone_transitions_get($timezone);
$key2 = count($transitions2) - 1;
$offset3 = $transitions2[$key2]['offset'];
$lasttimestamp2 = $transitions2[$key2]['ts'];
$check = $lasttimestamp2 > $lasttimestamp;
if(!$check) {
$lasttimestamp2 = 4160077200;
$transitions3 = timezone_transitions_get($timezone, $lasttimestamp2);
$offset4 = $transitions3[0]['offset'];
if(7200 == $offset4) {
/*foreach($transitions2 as $key => $transition) {
if($lasttimestamp < $transition['ts']) {
if($key2 > $key) {
$key2 = $key;
}
}
}*/
$key3 = $key2 - 1;
$key4 = 0;
if($key2 > 0) {
$key4 = 1;
} else {
$key3 = 0;
}
//$transitiontimestamp = array($transitions2[$key3], $key4 => $transitions2[$key2]);
// code here
$arr = explode('T', $transitions[0]['time']);
$copy = $arr[0];
$arr = explode('+', $arr[1]);
$string = $copy . ' ' . $arr[0];
$date2 = null;
$date1 = null;
unset($date2);
unset($date1);
$string = strtr($string, array('+' => ''));
$date1 = date_create($string, $timezone_utc);
$offset1 = $transitions[0]['offset'];
$timestampsec = '+';
if(0 > $offset1) {
$timestampsec = '';
}
$timestampsec = $timestampsec . $offset1 . ' sec';
$date2 = date_modify($date1, $timestampsec);
$string = date_format($date2, 'Y-m-d H:i:s');
$date2 = null;
$date1 = null;
unset($date2);
unset($date1);
$date1 = date_create($string, $timezone);
$offset2 = date_format($date1, 'Z');
$offset2 = (int) $offset2;
if($offset1 != $offset2) {
$key4 = $key3;
//$offset3 = $transitions2[$key2]['offset'];
if($offset2 == $offset3) {
$key4 = $key2;
}
$transitions[0]['offset'] = $transitions2[$key4]['offset'];
$transitions[0]['isdst'] = $transitions2[$key4]['isdst'];
$transitions[0]['abbr'] = $transitions2[$key4]['abbr'];
}
}
}
$key3 = 0;
$key4 = 0;
} elseif($transitions[0]['ts'] == $transitions[1]['ts']) {
unset($transitions[1]);
if(3 > $count) {
$key3 = 0;
$key4 = 0;
} else {
$key3 = 2;
}
}
$transitiontimestamp2 = array($transitions[0], $key4 => $transitions[$key3]);
} else {
//
//$transitions2 = timezone_transitions_get($timezone);
}
}
var_dump($transitiontimestamp2[0], $offset1, $offset2, $offset4);
?>
- Output for git.master, git.master_jit, rfc.property-hooks
- Warning: Undefined variable $offset1 in /in/FGbtV on line 117
Warning: Undefined variable $offset2 in /in/FGbtV on line 117
array(5) {
["ts"]=>
int(4160077200)
["time"]=>
string(25) "2101-10-30T01:00:00+00:00"
["offset"]=>
int(3600)
["isdst"]=>
bool(false)
["abbr"]=>
string(3) "CET"
}
NULL
NULL
int(3600)
This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.
Active branches
Archived branches
Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page
preferences:
32.17 ms | 406 KiB | 5 Q