Store in GIT

This commit is contained in:
2026-06-17 15:46:26 +02:00
parent 47150cc7ca
commit 876ad89e72
134 changed files with 31034 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
<?php
header('Content-Type: application/json');
$ip = $_SERVER['REMOTE_ADDR'];
$timezn = geoip_time_zone_by_country_and_region(geoip_country_code_by_name($ip));
if($timezn == "")
{
echo '{"timezone":"11"}';
exit;
}
$time = new DateTime('now', new DateTimeZone($timezn));
$timezoneOffset = $time->format('P');
$DST = $time->format('I');
if (strpos($timezoneOffset , '-') !== FALSE)
{
$str = intval(substr($timezoneOffset, 1, 2));
$arrayval = 11 - $str;
//check DST
if($DST)
$arrayval -= 1;
echo '{"timezone":"' . $arrayval . '"}';
}
else if (strpos($timezoneOffset , '+') !== FALSE)
{
$str = intval(substr($timezoneOffset, 1, 2));
$arrayval = 11 + $str;
//check DST
if($DST)
$arrayval -= 1;
echo '{"timezone":"' . $arrayval . '"}';
}
else
{
echo '{"timezone":"11"}';
}
?>