function getSunset($format) { global $schedulePars; return date_sunset(time(), $format, $schedulePars[SCHEDULE_LATITUDE], $schedulePars[SCHEDULE_LONGTITUDE], SCHEDULE_ZENITH, getTimeOffset()); }
} } $_SESSION['mydevices'] = $mydevices; } //Creation des InfoWindow // moon phase $moonphase = new MoonPhase(); $phase = intval($moonphase->phase() * 28 + 0.5) % 28; $imgnum = sprintf('%1$02d', $phase); $moonimg = "'" . 'icone/Moon/MoonDay' . $imgnum . '.png' . "'"; $moonpercent = intval($moonphase->phase() * 1000) / 10; $lumen = intval($moonphase->illumination() * 1000) / 10; $day = idate('d'); $month = idate('m'); $year = idate('Y'); $timeOffset = getTimeOffset($timezone); function daydiff($lat, $long) { $t = time(); $tp = $t - 24 * 60 * 60; $sun = date_sun_info($t, $lat, $long); $sunp = date_sun_info($tp, $lat, $long); return $sun['sunset'] - $sun['sunrise'] - ($sunp['sunset'] - $sunp['sunrise']); } function daylength($lat, $long) { $sun = date_sun_info(time(), $lat, $long); $daylength = $sun['sunset'] - $sun['sunrise']; $dayH = intval($daylength / 3600); $day = $daylength - 3600 * $dayH; $dayM = intval($day / 60);